| 45 | } |
| 46 | |
| 47 | void KThread::internalCleanup() { |
| 48 | { |
| 49 | BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(this->waitingForSignalToEndCond); |
| 50 | BOXEDWINE_CONDITION_SIGNAL_ALL(this->waitingForSignalToEndCond); |
| 51 | } |
| 52 | if (!KSystem::shutingDown && this->clear_child_tid && this->process && memory->canWrite(this->clear_child_tid, 4)) { |
| 53 | memory->writed(this->clear_child_tid, 0); |
| 54 | this->futex(this->clear_child_tid, 1, 0xffffffff, 0, 0, 0, false); |
| 55 | } |
| 56 | this->clear_child_tid = 0; |
| 57 | #ifndef BOXEDWINE_MULTI_THREADED |
| 58 | if (this->waitingCond) { |
| 59 | BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(*this->waitingCond); |
| 60 | this->waitThreadNode.remove(); |
| 61 | this->waitingCond = nullptr; |
| 62 | } |
| 63 | #endif |
| 64 | this->clearFutexes(); |
| 65 | this->exitRobustList(); |
| 66 | this->robustList = 0; |
| 67 | if (this->process) { |
| 68 | this->process->removeThread(this); |
| 69 | } |
| 70 | unscheduleThread(this); |
| 71 | } |
| 72 | |
| 73 | void KThread::reset() { |
| 74 | memory->threadCleanup(id); |
no test coverage detected