team_free_user_thread(): Unset the thread's user thread before putting it in
the free list. Do that with the threads lock held. This allows other threads to freely access a thread's user thread structure while holding the threads lock. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29577 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2697,6 +2697,11 @@ team_free_user_thread(struct thread* thread)
|
|||||||
|
|
||||||
InterruptsSpinLocker _(gTeamSpinlock);
|
InterruptsSpinLocker _(gTeamSpinlock);
|
||||||
|
|
||||||
|
// detach from thread
|
||||||
|
SpinLocker threadLocker(gThreadSpinlock);
|
||||||
|
thread->user_thread = NULL;
|
||||||
|
threadLocker.Unlock();
|
||||||
|
|
||||||
entry->thread = userThread;
|
entry->thread = userThread;
|
||||||
entry->next = thread->team->free_user_threads;
|
entry->next = thread->team->free_user_threads;
|
||||||
thread->team->free_user_threads = entry;
|
thread->team->free_user_threads = entry;
|
||||||
|
|||||||
Reference in New Issue
Block a user