| 117 | } |
| 118 | |
| 119 | void BoxedWineCondition::waitWithTimeout(std::unique_lock<std::mutex>& lock, U32 ms) { |
| 120 | KThread* thread = KThread::currentThread(); |
| 121 | if (thread) { |
| 122 | thread->waitingCond = shared_from_this(); |
| 123 | } |
| 124 | this->c.wait_for(lock, std::chrono::milliseconds(KSystem::emulatedMilliesToHost(ms))); |
| 125 | if (thread) { |
| 126 | thread->waitingCond = nullptr; |
| 127 | } |
| 128 | if (parentCount) { |
| 129 | for (int i = 0; i < MAX_PARENTS; i++) { |
| 130 | std::shared_ptr<BoxedWineCondition> parent; |
| 131 | { |
| 132 | const std::lock_guard<std::mutex> lock(parentsMutex); |
| 133 | parent = parents[i].lock(); |
| 134 | } |
| 135 | if (parent) { |
| 136 | BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(parent); |
| 137 | parent->signalAll(); |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | void BoxedWineCondition::unlock() { |
| 144 | this->lockOwner = 0; |
nothing calls this directly
no test coverage detected