Skip to content

Instantly share code, notes, and snippets.

@robholland
Created April 15, 2009 12:08
Show Gist options
  • Save robholland/95734 to your computer and use it in GitHub Desktop.
Save robholland/95734 to your computer and use it in GitHub Desktop.
t1_setup = false
t2_setup = false
$bad = true
m = Thread.new do
begin
t = Thread.new do
begin
t2_setup = true
sleep
ensure
$bad = false
end
end
t1_setup = true
sleep
ensure
t.kill
end
end
Thread.pass until t1_setup and t2_setup
m.kill
puts $bad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment