From c491fcec1f0f03c1147d81b65cd9f2293aa60dbc Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 23 Mar 2000 22:20:31 +0000 Subject: [PATCH] (__pthread_reset_pthread_once): Reset once_masterlock. --- linuxthreads/mutex.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c index f35cab8ae67..5f0b81b7025 100644 --- a/linuxthreads/mutex.c +++ b/linuxthreads/mutex.c @@ -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); +} -- 2.47.3