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

Method wait

source/util/synchronization.cpp:95–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void 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
119void BoxedWineCondition::waitWithTimeout(std::unique_lock<std::mutex>& lock, U32 ms) {
120 KThread* thread = KThread::currentThread();

Callers 1

bitmapCompareThreadFunction · 0.45

Calls 4

signalAllMethod · 0.80
addToBackMethod · 0.80
unscheduleThreadFunction · 0.50
lockMethod · 0.45

Tested by

no test coverage detected