summaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
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)