summaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-10 06:49:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-10 06:49:15 +0000
commit2e25df66cedd76609685fd0c6ff25d3ad42f2e3a (patch)
tree27ec5243511847068a9cf5eb077c1368f95606a4 /thread_pthread.c
parent029179a9f343ff36fc1e37cb9bdfa5db0e9c2408 (diff)
downloadruby-2e25df66cedd76609685fd0c6ff25d3ad42f2e3a.tar.gz
ruby-2e25df66cedd76609685fd0c6ff25d3ad42f2e3a.tar.xz
ruby-2e25df66cedd76609685fd0c6ff25d3ad42f2e3a.zip
* thread_pthread.c (native_mutex_reinitialize_atfork): release and
re-acquire the lock at re-initialization. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 6d011b81b..af0b28644 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -71,7 +71,10 @@ native_mutex_initialize(pthread_mutex_t *lock)
}
}
-#define native_mutex_reinitialize_atfork(lock) native_mutex_initialize(lock)
+#define native_mutex_reinitialize_atfork(lock) (\
+ native_mutex_unlock(lock), \
+ native_mutex_initialize(lock), \
+ native_mutex_lock(lock))
static void
native_mutex_destroy(pthread_mutex_t *lock)