MCPcopy Create free account
hub / github.com/CommE2E/comm / try_push

Method try_push

native/cpp/CommonCpp/Tools/MPMCQueue.h:33–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 }
32
33 bool try_push(T &&item) {
34 {
35 std::unique_lock<std::mutex> lk(mutex);
36 if (content.size() == capacity)
37 return false;
38 content.push_back(std::move(item));
39 }
40 not_empty.notify_one();
41 return true;
42 }
43
44 void pop(T &item) {
45 {

Callers 1

scheduleTaskMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected