MCPcopy Create free account
hub / github.com/cemu-project/Cemu / OSDetachThread

Function OSDetachThread

src/Cafe/OS/libs/coreinit/coreinit_Thread.cpp:664–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662 }
663
664 void OSDetachThread(OSThread_t* thread)
665 {
666 __OSLockScheduler();
667 thread->attr |= OSThread_t::ATTR_BIT::ATTR_DETACHED;
668 if (thread->state == OSThread_t::THREAD_STATE::STATE_MORIBUND)
669 {
670 // exit thread
671 // ?
672
673 // todo -> call deallocator
674 thread->state = OSThread_t::THREAD_STATE::STATE_NONE;
675 thread->id = 0x8000;
676 coreinit::__OSDeactivateThread(thread);
677 if (!thread->joinQueue.isEmpty())
678 {
679 // handle join queue
680 thread->joinQueue.wakeupEntireWaitQueue(true);
681 }
682 }
683 __OSUnlockScheduler();
684 }
685
686 bool OSJoinThread(OSThread_t* thread, uint32be* exitValue)
687 {

Calls 5

__OSLockSchedulerFunction · 0.85
__OSDeactivateThreadFunction · 0.85
__OSUnlockSchedulerFunction · 0.85
wakeupEntireWaitQueueMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected