MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / OSSuspendThread

Function OSSuspendThread

src/dolphin/src/os/OSThread.c:442–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442s32 OSSuspendThread(OSThread* thread)
443{
444 BOOL enabled;
445 s32 suspendCount;
446
447 enabled = OSDisableInterrupts();
448 suspendCount = thread->suspend++;
449 if (suspendCount == 0)
450 {
451 switch (thread->state)
452 {
453 case OS_THREAD_STATE_RUNNING:
454 RunQueueHint = TRUE;
455 thread->state = OS_THREAD_STATE_READY;
456 break;
457 case OS_THREAD_STATE_READY:
458 UnsetRun(thread);
459 break;
460 case OS_THREAD_STATE_WAITING:
461 RemoveItem(thread->queue, thread, link);
462 thread->priority = 32;
463 AddTail(thread->queue, thread, link);
464 if (thread->mutex)
465 {
466 UpdatePriority(thread->mutex->thread);
467 }
468 break;
469 }
470
471 __OSReschedule();
472 }
473 OSRestoreInterrupts(enabled);
474 return suspendCount;
475}
476
477void OSSleepThread(OSThreadQueue* queue)
478{

Callers 1

GXCPInterruptHandlerFunction · 0.85

Calls 4

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

Tested by

no test coverage detected