diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/thread/test_cv.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/thread/test_cv.rb b/test/thread/test_cv.rb index a093f373b1..b010b1fe5c 100644 --- a/test/thread/test_cv.rb +++ b/test/thread/test_cv.rb @@ -228,8 +228,14 @@ INPUT end thrs.each { 3.times { Thread.pass } } pid = fork do - mutex.synchronize { condvar.broadcast } - exit!(0) + th = Thread.new do + mutex.synchronize { condvar.wait(mutex) } + :ok + end + until th.join(0.01) + mutex.synchronize { condvar.broadcast } + end + exit!(th.value == :ok ? 0 : 1) end _, s = Process.waitpid2(pid) assert_predicate s, :success?, 'no segfault [ruby-core:86316] [Bug #14634]' |