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

Method try_pop

async_simple/util/Queue.h:69–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 bool try_pop(T &item) {
70 std::unique_lock lock(_mutex, std::try_to_lock);
71 if (!lock || _queue.empty())
72 return false;
73
74 item = std::move(_queue.front());
75 _queue.pop();
76 return true;
77 }
78
79 // non-blocking pop an item, maybe pop failed.
80 // predict is an extension pop condition, default is null.

Callers

nothing calls this directly

Calls 3

frontMethod · 0.80
emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected