threads = []
x = 1
(1..5).each do |i|
x += 1
x2 = x
threads << Thread.new {sleep 1; Thread.current[:output] = "#{x2}" }
end
threads.each do |t|
t.join
puts t[:output]
end
dGhyZWFkcyA9IFtdCnggPSAxCigxLi41KS5lYWNoIGRvIHxpfAogIHggKz0gMQogIHgyID0geAogIHRocmVhZHMgPDwgVGhyZWFkLm5ldyB7c2xlZXAgMTsgVGhyZWFkLmN1cnJlbnRbOm91dHB1dF0gPSAiI3t4Mn0iIH0KZW5kCnRocmVhZHMuZWFjaCBkbyB8dHwKICB0LmpvaW4KICBwdXRzIHRbOm91dHB1dF0KZW5kCg==