MCPcopy Create free account
hub / github.com/doldecomp/mkdd / OSSuspendThread

Function OSSuspendThread

libs/dolphin/os/OSThread.c:516–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515
516s32 OSSuspendThread(OSThread* thread) {
517 BOOL enabled;
518 s32 suspendCount;
519
520 enabled = OSDisableInterrupts();
521 suspendCount = thread->suspend++;
522 if (suspendCount == 0) {
523 switch (thread->state) {
524 case OS_THREAD_STATE_RUNNING:
525 RunQueueHint = TRUE;
526 thread->state = OS_THREAD_STATE_READY;
527 break;
528 case OS_THREAD_STATE_READY:
529 UnsetRun(thread);
530 break;
531 case OS_THREAD_STATE_WAITING:
532 RemoveItem(thread->queue, thread, link);
533 thread->priority = 32;
534 AddTail(thread->queue, thread, link);
535 if (thread->mutex) {
536 UpdatePriority(thread->mutex->thread);
537 }
538 break;
539 }
540
541 __OSReschedule();
542 }
543 OSRestoreInterrupts(enabled);
544 return suspendCount;
545}
546
547void OSSleepThread(OSThreadQueue* queue) {
548 BOOL enabled;

Callers 6

ReaderFunction · 0.85
AudioDecoderForOnMemoryFunction · 0.85
VideoDecoderForOnMemoryFunction · 0.85
VideoDecodeFunction · 0.85
threadSleepMethod · 0.85
panic_f_vaMethod · 0.85

Calls 4

OSDisableInterruptsFunction · 0.85
UnsetRunFunction · 0.85
UpdatePriorityFunction · 0.85
__OSRescheduleFunction · 0.85

Tested by

no test coverage detected