Author: bonefish Date: 2011-05-12 01:55:35 +0200 (Thu, 12 May 2011) New Revision: 41455 Changeset: https://dev.haiku-os.org/changeset/41455 Modified: haiku/branches/developer/bonefish/signals/headers/private/kernel/thread.h haiku/branches/developer/bonefish/signals/src/system/kernel/sem.cpp Log: thread_is_interrupted(): Holding the scheduler lock is no longer optional. Modified: haiku/branches/developer/bonefish/signals/headers/private/kernel/thread.h =================================================================== --- haiku/branches/developer/bonefish/signals/headers/private/kernel/thread.h 2011-05-11 23:53:50 UTC (rev 41454) +++ haiku/branches/developer/bonefish/signals/headers/private/kernel/thread.h 2011-05-11 23:55:35 UTC (rev 41455) @@ -138,7 +138,7 @@ /*! Checks whether the current thread would immediately be interrupted when blocking it with the given wait/interrupt flags. - The caller can hold the scheduler lock, but doesn't have to. + The caller must hold the scheduler lock. \param thread The current thread. \param flags Wait/interrupt flags to be considered. Relevant are: Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/sem.cpp =================================================================== --- haiku/branches/developer/bonefish/signals/src/system/kernel/sem.cpp 2011-05-11 23:53:50 UTC (rev 41454) +++ haiku/branches/developer/bonefish/signals/src/system/kernel/sem.cpp 2011-05-11 23:55:35 UTC (rev 41455) @@ -824,7 +824,9 @@ // do a quick check to see if the thread has any pending signals // this should catch most of the cases where the thread had a signal + SpinLocker schedulerLocker(gSchedulerLock); if (thread_is_interrupted(thread, flags)) { + schedulerLocker.Unlock(); sSems[slot].u.used.count += count; status = B_INTERRUPTED; // the other semaphore will be released later @@ -850,7 +852,7 @@ semToBeReleased = -1; } - SpinLocker schedulerLocker(gSchedulerLock); + schedulerLocker.Lock(); status_t acquireStatus = timeout == B_INFINITE_TIMEOUT ? thread_block_locked(thread)