__ASM__ ("pushf;\n\tpop %0" : "=r"(IF));
IF &= 0x200; // AND out all but the interrupt flag
+ ASSERT( !CPU_HAS_LOCK(Lock) );
+
#if TRACE_LOCKS
if( TRACE_LOCK_COND )
{
toWake->RetStatus = given;
// Wake the sleeper
- SHORTLOCK( &glThreadListLock );
if( toWake->Status != THREAD_STAT_ACTIVE )
Threads_AddActive(toWake);
- SHORTREL( &glThreadListLock );
}
SHORTREL( &Sem->Protector );
return -EALREADY;
case THREAD_STAT_SLEEPING:
- SHORTLOCK( &glThreadListLock );
// Remove from sleeping queue
+ SHORTLOCK( &glThreadListLock );
Threads_int_DelFromQueue(&gSleepingThreads, Thread);
-
SHORTREL( &glThreadListLock );
+
Threads_AddActive( Thread );
#if DEBUG_TRACE_STATE