]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__pthread_reset_pthread_once): Reset once_masterlock.
authorUlrich Drepper <drepper@redhat.com>
Thu, 23 Mar 2000 22:20:31 +0000 (22:20 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 23 Mar 2000 22:20:31 +0000 (22:20 +0000)
linuxthreads/mutex.c

index f35cab8ae67b83ee5067ba88ca0d5692956608e5..5f0b81b7025716da106a5deba163799db2240606 100644 (file)
@@ -223,3 +223,15 @@ int __pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
   return 0;
 }
 strong_alias (__pthread_once, pthread_once)
+
+/*
+ * This is called in the child process after a fork to make
+ * sure that the global mutex pthread_once is not held,
+ * and that the condition variable is reset to an initial state.
+ */
+
+void __pthread_reset_pthread_once(void)
+{
+  pthread_mutex_init(&once_masterlock, NULL);
+  pthread_cond_init(&once_finished, NULL);
+}