diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-18 09:25:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-18 09:25:11 +0000 |
commit | d797b3a528165b221672c4b6b65aad52c0e9dde9 (patch) | |
tree | 5c6cbf96233c89da1a76a8cf939c0f7829a88c99 /bootstraptest | |
parent | 48f493bfc53c1502b270b79a03ec36cfa789b075 (diff) | |
download | ruby-d797b3a528165b221672c4b6b65aad52c0e9dde9.tar.gz ruby-d797b3a528165b221672c4b6b65aad52c0e9dde9.tar.xz ruby-d797b3a528165b221672c4b6b65aad52c0e9dde9.zip |
* thread.c (rb_thread_atfork_internal): reinitialize global lock
at fork to get rid of deadlock. based on the patch from Hongli
Lai in [ruby-core:26783]. [ruby-core:26361]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 4b715a154..e46362616 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]' |