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

Function OSResumeThread

src/dolphin/src/os/OSThread.c:407–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407s32 OSResumeThread(OSThread* thread)
408{
409 BOOL enabled;
410 s32 suspendCount;
411
412 enabled = OSDisableInterrupts();
413 suspendCount = thread->suspend--;
414 if (thread->suspend < 0)
415 {
416 thread->suspend = 0;
417 }
418 else if (thread->suspend == 0)
419 {
420 switch (thread->state)
421 {
422 case OS_THREAD_STATE_READY:
423 thread->priority = __OSGetEffectivePriority(thread);
424 SetRun(thread);
425 break;
426 case OS_THREAD_STATE_WAITING:
427 RemoveItem(thread->queue, thread, link);
428 thread->priority = __OSGetEffectivePriority(thread);
429 AddPrio(thread->queue, thread, link);
430 if (thread->mutex)
431 {
432 UpdatePriority(thread->mutex->thread);
433 }
434 break;
435 }
436 __OSReschedule();
437 }
438 OSRestoreInterrupts(enabled);
439 return suspendCount;
440}
441
442s32 OSSuspendThread(OSThread* thread)
443{

Callers 1

GXCPInterruptHandlerFunction · 0.85

Calls 5

OSDisableInterruptsFunction · 0.85
__OSGetEffectivePriorityFunction · 0.85
SetRunFunction · 0.85
UpdatePriorityFunction · 0.85
__OSRescheduleFunction · 0.85

Tested by

no test coverage detected