MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / signalThread

Method signalThread

source/util/synchronization.cpp:197–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void 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
218void BoxedWineCondition::signal() {
219 this->signalThread(false);

Callers 3

signalMethod · 0.95
signalAllMethod · 0.95
runMethod · 0.80

Calls 6

kpanicFunction · 0.85
removeTimerFunction · 0.85
frontMethod · 0.80
scheduleThreadFunction · 0.50
sizeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected