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/libpthread/thread/thr_find_thread.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/libpthread/thread/thr_find_thread.c')
-rw-r--r-- | lib/libpthread/thread/thr_find_thread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_find_thread.c b/lib/libpthread/thread/thr_find_thread.c index e8d9fcb..5a64640 100644 --- a/lib/libpthread/thread/thr_find_thread.c +++ b/lib/libpthread/thread/thr_find_thread.c @@ -90,7 +90,7 @@ _thr_ref_delete(struct pthread *curthread, struct pthread *thread) if (curthread != NULL) curthread->critical_count--; if ((thread->refcount == 0) && - (thread->flags & THR_FLAGS_GC_SAFE) != 0) + (thread->tlflags & TLFLAGS_GC_SAFE) != 0) THR_GCLIST_ADD(thread); KSE_LOCK_RELEASE(curkse, &_thread_list_lock); _kse_critical_leave(crit); |