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

Method push

async_simple/coro/test/ConditionVariableTest.cpp:256–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254TEST_F(ConditionVariableTest, testNotifyOneQueue) {
255 struct Queue {
256 void push(int i) {
257 {
258 std::unique_lock lk(mutex);
259 q.push(i);
260 }
261 cv.notifyOne();
262 }
263 Lazy<> pop(int& i) {
264 std::unique_lock lk(mutex);
265 co_await cv.wait(mutex, [&]() { return !q.empty(); });

Callers 1

TEST_FFunction · 0.45

Calls 1

notifyOneMethod · 0.80

Tested by

no test coverage detected