Skip to content

Instantly share code, notes, and snippets.

@cutalion
Last active November 8, 2016 16:13
Show Gist options
  • Save cutalion/684a89e11baa9d021453f69479c0ed88 to your computer and use it in GitHub Desktop.
Save cutalion/684a89e11baa9d021453f69479c0ed88 to your computer and use it in GitHub Desktop.
@start = false
t1 = Thread.new do
while !@start
sleep 0.001
end
puts 'started 1'
end
t2 = Thread.new do
while !@start
sleep 0.0001
end
puts 'started 2'
end
puts 'Ready'; sleep 0.3
puts 'Set'; sleep 0.3
puts 'Go'; sleep 0.3
@start = true
t1.join
t2.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment