if( MaxToTake < 0 ) {
Log_Warning("Threads", "Semaphore_Wait: User bug - MaxToTake(%i) < 0, Sem=%p(%s)",
MaxToTake, Sem, Sem->Name);
+ MaxToTake = 0;
}
SHORTLOCK( &Sem->Protector );
toWake->RetStatus = given;
// Wake the sleeper
- SHORTLOCK( &glThreadListLock );
if( toWake->Status != THREAD_STAT_ACTIVE )
Threads_AddActive(toWake);
- SHORTREL( &glThreadListLock );
}
SHORTREL( &Sem->Protector );