mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
It's unnecessary to lock the thread during creation. Simply extend
the scope of the active thread list lock. Approved by: re/jhb
This commit is contained in:
parent
e5cd12556d
commit
981f4968f0
1 changed files with 2 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue