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:
parent
e3820a0e5e
commit
9e83cc1768
@ -2697,6 +2697,11 @@ team_free_user_thread(struct thread* thread)
|
||||
|
||||
InterruptsSpinLocker _(gTeamSpinlock);
|
||||
|
||||
// detach from thread
|
||||
SpinLocker threadLocker(gThreadSpinlock);
|
||||
thread->user_thread = NULL;
|
||||
threadLocker.Unlock();
|
||||
|
||||
entry->thread = userThread;
|
||||
entry->next = thread->team->free_user_threads;
|
||||
thread->team->free_user_threads = entry;
|
||||
|
Loading…
Reference in New Issue
Block a user