- LOG("Locked and preparing for wait");
- // Wait
- us->RetStatus = EventMask; // HACK: Store EventMask in RetStatus
- SHORTLOCK( &glThreadListLock );
- us = Threads_RemActive();
- us->Status = THREAD_STAT_EVENTSLEEP;
- // Note stored anywhere because we're woken using other means
- SHORTREL( &glThreadListLock );
- SHORTREL( &us->IsLocked );
- Threads_int_WaitForStatusEnd(THREAD_STAT_EVENTSLEEP);
+ Threads_int_Sleep(THREAD_STAT_EVENTSLEEP, NULL, EventMask,
+ &us, NULL, &us->IsLocked);