MCPcopy Create free account
hub / github.com/alibaba/async_simple / pop

Method pop

async_simple/coro/test/ConditionVariableTest.cpp:263–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 cv.notifyOne();
262 }
263 Lazy<> pop(int& i) {
264 std::unique_lock lk(mutex);
265 co_await cv.wait(mutex, [&]() { return !q.empty(); });
266 i = q.front();
267 q.pop();
268 }
269 std::queue<int> q;
270 SpinLock mutex;
271 ConditionVariable<SpinLock> cv;

Callers 1

TEST_FFunction · 0.45

Calls 3

frontMethod · 0.80
waitMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected