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

Method try_push

async_simple/util/Queue.h:48–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 bool try_push(const T &item) {
49 {
50 std::unique_lock lock(_mutex, std::try_to_lock);
51 if (!lock)
52 return false;
53 _queue.push(item);
54 }
55 _cond.notify_one();
56 return true;
57 }
58
59 bool pop(T &item) {
60 std::unique_lock lock(_mutex);

Callers 1

scheduleByIdMethod · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected