* test/ruby/test_thread.rb: fix potential race condition.
The thread could have a "sleep" status because it tries to acquire the mutex, but does not have it yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
37ab3ed99d
commit
fab171e541
@ -1,3 +1,9 @@
|
|||||||
|
Mon Oct 5 20:39:32 2015 Benoit Daloze <eregontp@gmail.com>
|
||||||
|
|
||||||
|
* test/ruby/test_thread.rb: fix potential race condition.
|
||||||
|
The thread could have a "sleep" status because it tries
|
||||||
|
to acquire the mutex, but does not have it yet.
|
||||||
|
|
||||||
Mon Oct 5 15:39:30 2015 Zachary Scott <zzak@ruby-lang.org>
|
Mon Oct 5 15:39:30 2015 Zachary Scott <zzak@ruby-lang.org>
|
||||||
|
|
||||||
* numeric.c: [DOC] Overview for Numeric class by Joe Corcoran
|
* numeric.c: [DOC] Overview for Numeric class by Joe Corcoran
|
||||||
|
@ -914,9 +914,8 @@ q.pop
|
|||||||
sleep
|
sleep
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.pass until th.status == "sleep"
|
# acquired by another thread.
|
||||||
# acquired another thread.
|
Thread.pass until mutex.locked?
|
||||||
assert_equal(mutex.locked?, true)
|
|
||||||
assert_equal(mutex.owned?, false)
|
assert_equal(mutex.owned?, false)
|
||||||
ensure
|
ensure
|
||||||
th.kill if th
|
th.kill if th
|
||||||
|
Loading…
x
Reference in New Issue
Block a user