From df721e35be3c19465326438aaee1cf0445ce76b9 Mon Sep 17 00:00:00 2001 From: davidxu Date: Sat, 23 Oct 2004 23:28:36 +0000 Subject: 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 --- lib/libpthread/thread/thr_create.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libpthread/thread/thr_create.c') diff --git a/lib/libpthread/thread/thr_create.c b/lib/libpthread/thread/thr_create.c index 54bcd3b..03f467b 100644 --- a/lib/libpthread/thread/thr_create.c +++ b/lib/libpthread/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; -- cgit v1.1