From 9863dd8503db3fadb6ae84c6eee25d7ee94a2a5a Mon Sep 17 00:00:00 2001 From: mtm Date: Thu, 29 May 2003 20:40:50 +0000 Subject: It's unnecessary to lock the thread during creation. Simply extend the scope of the active thread list lock. Approved by: re/jhb --- lib/libthr/thread/thr_create.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/libthr/thread/thr_create.c') diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index c86f244..0b08562 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -171,7 +171,6 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, new_thread->uniqueid = next_uniqueid++; THREAD_LIST_LOCK; - _thread_critical_enter(new_thread); /* * Check if the garbage collector thread @@ -182,8 +181,6 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, /* Add the thread to the linked list of all threads: */ TAILQ_INSERT_HEAD(&_thread_list, new_thread, tle); - THREAD_LIST_UNLOCK; - /* * Create the thread. * @@ -200,11 +197,11 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, PANIC("thr_create"); } + THREAD_LIST_UNLOCK; + /* Return a pointer to the thread structure: */ (*thread) = new_thread; - _thread_critical_exit(new_thread); - /* * Start a garbage collector thread * if necessary. -- cgit v1.1