| 195 | } |
| 196 | |
| 197 | void BoxedWineCondition::signalThread(bool all) { |
| 198 | while (this->waitingThreads.size()) { |
| 199 | KThread* thread = this->waitingThreads.front()->data; |
| 200 | this->waitingThreads.front()->remove(); |
| 201 | #ifdef _DEBUG |
| 202 | if (!thread->waitingCond) { |
| 203 | kpanic("shouldn't signal a thread that is not waiting"); |
| 204 | } |
| 205 | #endif |
| 206 | thread->waitingCond = nullptr; |
| 207 | if (thread->condTimer.active) { |
| 208 | removeTimer(&thread->condTimer); |
| 209 | thread->condTimer.cond = nullptr; |
| 210 | } |
| 211 | scheduleThread(thread); |
| 212 | if (!all) { |
| 213 | break; |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | void BoxedWineCondition::signal() { |
| 219 | this->signalThread(false); |
no test coverage detected