summaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-18 09:25:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-18 09:25:11 +0000
commitd797b3a528165b221672c4b6b65aad52c0e9dde9 (patch)
tree5c6cbf96233c89da1a76a8cf939c0f7829a88c99 /thread.c
parent48f493bfc53c1502b270b79a03ec36cfa789b075 (diff)
downloadruby-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 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 5caf1da4f..9c6ec5b73 100644
--- a/thread.c
+++ b/thread.c
@@ -2710,6 +2710,7 @@ rb_thread_atfork_internal(int (*atfork)(st_data_t, st_data_t, st_data_t))
VALUE thval = th->self;
vm->main_thread = th;
+ native_mutex_reinitialize_atfork(&th->vm->global_vm_lock);
st_foreach(vm->living_threads, atfork, (st_data_t)th);
st_clear(vm->living_threads);
st_insert(vm->living_threads, thval, (st_data_t)th->thread_id);