-
-
Save headius/bff45c460ebe0893f07f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_switch_while_busy_loop | |
bug1402 = "[ruby-dev:38319] [Bug #1402]" | |
flag = true | |
th = Thread.current | |
waiter = Thread.start { | |
sleep 0.1 | |
flag = false | |
sleep 1 | |
th.raise(bug1402) | |
} | |
assert_nothing_raised(RuntimeError, bug1402) do | |
nil while flag | |
end | |
assert(!flag, bug1402) | |
ensure | |
waiter.kill.join | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment