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:
Ingo Weinhold 2009-03-18 01:46:29 +00:00
parent e3820a0e5e
commit 9e83cc1768

View File

@ -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;