| 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 | { |
no test coverage detected