diff options
author | deischen <deischen@FreeBSD.org> | 2003-11-04 20:04:45 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-11-04 20:04:45 +0000 |
commit | 1191fa7e324052c4d97e45f85cbb566eb985c1c6 (patch) | |
tree | c66d125bd34129e0d434c2444369c5dd31c55ad0 /lib/libkse/thread/thr_init.c | |
parent | 573b8090444db7cfee8d60b937cc6d39632c8bbc (diff) | |
download | FreeBSD-src-1191fa7e324052c4d97e45f85cbb566eb985c1c6.zip FreeBSD-src-1191fa7e324052c4d97e45f85cbb566eb985c1c6.tar.gz |
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
Diffstat (limited to 'lib/libkse/thread/thr_init.c')
-rw-r--r-- | lib/libkse/thread/thr_init.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c index 7f60994..76eeee4 100644 --- a/lib/libkse/thread/thr_init.c +++ b/lib/libkse/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 |