MCPcopy Create free account
hub / github.com/3rdparty/libprocess / wait

Method wait

src/semaphore.hpp:142–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140{
141public:
142 void wait()
143 {
144 // NOTE: we must check `commissioned` AFTER we have incremented
145 // `waiters` otherwise we might race with `decomission()` and fail
146 // to properly get signaled.
147 waiters.fetch_add(1);
148
149 if (!comissioned.load()) {
150 waiters.fetch_sub(1);
151 return;
152 }
153
154 KernelSemaphore::wait();
155
156 waiters.fetch_sub(1);
157 }
158
159 void decomission()
160 {

Callers

nothing calls this directly

Calls 1

waitFunction · 0.70

Tested by

no test coverage detected