Fixed a bug in put_death_stack_and_reschedule(): release_sem_etc() was called
with the thread lock held, which might have caused a panic later on, if there was another thread waiting for the death stack semaphore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13769 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -722,11 +722,13 @@ put_death_stack_and_reschedule(uint32 index)
|
||||
|
||||
disable_interrupts();
|
||||
GRAB_THREAD_LOCK();
|
||||
|
||||
sDeathStackBitmap &= ~(1 << index);
|
||||
RELEASE_THREAD_LOCK();
|
||||
|
||||
release_sem_etc(sDeathStackSem, 1, B_DO_NOT_RESCHEDULE);
|
||||
// we must not have acquired the thread lock when releasing a semaphore
|
||||
|
||||
GRAB_THREAD_LOCK();
|
||||
scheduler_reschedule();
|
||||
// requires thread lock to be held
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user