| 93 | } |
| 94 | |
| 95 | void BoxedWineCondition::wait(std::unique_lock<std::mutex>& lock) { |
| 96 | KThread* thread = KThread::currentThread(); |
| 97 | if (thread) { |
| 98 | thread->waitingCond = shared_from_this(); |
| 99 | } |
| 100 | this->c.wait(lock); |
| 101 | if (thread) { |
| 102 | thread->waitingCond = nullptr; |
| 103 | } |
| 104 | if (parentCount) { |
| 105 | for (int i = 0; i < MAX_PARENTS; i++) { |
| 106 | std::shared_ptr<BoxedWineCondition> parent; |
| 107 | { |
| 108 | const std::lock_guard<std::mutex> lock(parentsMutex); |
| 109 | parent = parents[i].lock(); |
| 110 | } |
| 111 | if (parent) { |
| 112 | BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(parent); |
| 113 | parent->signalAll(); |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void BoxedWineCondition::waitWithTimeout(std::unique_lock<std::mutex>& lock, U32 ms) { |
| 120 | KThread* thread = KThread::currentThread(); |
no test coverage detected