diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-10-23 23:28:36 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-10-23 23:28:36 +0000 |
commit | df721e35be3c19465326438aaee1cf0445ce76b9 (patch) | |
tree | 95da86c441c1081dff7d70fbd4ecebcf91db48ea /lib/libkse/thread/thr_create.c | |
parent | 590558cea722536b653cc600ce15022b909daf8d (diff) | |
download | FreeBSD-src-df721e35be3c19465326438aaee1cf0445ce76b9.zip FreeBSD-src-df721e35be3c19465326438aaee1cf0445ce76b9.tar.gz |
1. Move thread list flags into new separate member, and atomically
put DEAD thread on GC list, this closes a race between pthread_join
and thr_cleanup.
2. Introduce a mutex to protect tcb initialization, tls allocation and
deallocation code in rtld seems no lock protection or it is broken,
under stress testing, memory is corrupted.
Reviewed by: deischen
patch partly provided by: deischen
Diffstat (limited to 'lib/libkse/thread/thr_create.c')
-rw-r--r-- | lib/libkse/thread/thr_create.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_create.c b/lib/libkse/thread/thr_create.c index 54bcd3b..03f467b 100644 --- a/lib/libkse/thread/thr_create.c +++ b/lib/libkse/thread/thr_create.c @@ -234,6 +234,7 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, new_thread->specific_data_count = 0; new_thread->cleanup = NULL; new_thread->flags = 0; + new_thread->tlflags = 0; new_thread->continuation = NULL; new_thread->wakeup_time.tv_sec = -1; new_thread->lock_switch = 0; |