diff options
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_thread.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb index 4b715a1545..e463626167 100644 --- a/bootstraptest/test_thread.rb +++ b/bootstraptest/test_thread.rb @@ -408,3 +408,22 @@ assert_equal 'ok', %{ require "./zzz.rb" $result } + +assert_finish 3, %q{ + require 'thread' + + lock = Mutex.new + cond = ConditionVariable.new + t = Thread.new do + lock.synchronize do + cond.wait(lock) + end + end + + pid = fork do + # Child + STDOUT.write "This is the child process.\n" + STDOUT.write "Child process exiting.\n" + end + Process.waitpid(pid) +}, '[ruby-core:26361]' |