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

Function OSExitThread

libs/dolphin/os/OSThread.c:396–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396void OSExitThread(void *val)
397{
398 OSThread *thread;
399 BOOL enable;
400
401 enable = OSDisableInterrupts();
402 thread = __OSCurrentThread;
403 OSClearContext(&thread->context);
404
405 if (thread->attr & OS_THREAD_ATTR_DETACH)
406 {
407 RemoveItem(&__OSActiveThreadQueue, thread, linkActive);
408 thread->state = OS_THREAD_STATE_NULL;
409 }
410 else
411 {
412 thread->state = OS_THREAD_STATE_MORIBUND;
413 thread->val = val;
414 }
415
416 __OSUnlockAllMutex(thread);
417 OSWakeupThread(&thread->queueJoin);
418 RunQueueHint = TRUE;
419 if (RunQueueHint != FALSE)
420 {
421 SelectThread(FALSE);
422 }
423
424 OSRestoreInterrupts(enable);
425}
426
427void OSCancelThread(OSThread* thread) {
428 BOOL enabled;

Callers 1

runMethod · 0.85

Calls 4

OSDisableInterruptsFunction · 0.85
__OSUnlockAllMutexFunction · 0.85
OSWakeupThreadFunction · 0.85
SelectThreadFunction · 0.85

Tested by

no test coverage detected