From 4c1123c1c023bff3a413efecc581d1508a7d211c Mon Sep 17 00:00:00 2001 From: Daniel Eischen Date: Tue, 4 Nov 2003 20:04:45 +0000 Subject: Add an implementation for pthread_atfork(). Aside from the POSIX requirements for pthread_atfork(), when fork()ing, take the malloc lock to keep malloc state consistent in the child. Reviewed by: davidxu --- lib/libpthread/thread/thr_init.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libpthread/thread/thr_init.c') diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c index 7f6099458d8c..76eeee4af70b 100644 --- a/lib/libpthread/thread/thr_init.c +++ b/lib/libpthread/thread/thr_init.c @@ -461,6 +461,8 @@ init_private(void) /* Initialize everything else. */ TAILQ_INIT(&_thread_list); TAILQ_INIT(&_thread_gc_list); + TAILQ_INIT(&_thr_atfork_list); + _pthread_mutex_init(&_thr_atfork_mutex, NULL); /* * Initialize the lock for temporary installation of signal -- cgit v1.2.3