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