MCPcopy Create free account
hub / github.com/dmlc/parameter_server / try_pop

Method try_pop

src/util/threadsafe_queue.h:41–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 bool try_pop(T& value) {
42 std::lock_guard<std::mutex> lk(mut);
43 if(data_queue.empty())
44 return false;
45 value=std::move(data_queue.front());
46 data_queue.pop();
47 return true;
48 }
49
50 std::shared_ptr<T> try_pop() {
51 std::lock_guard<std::mutex> lk(mut);

Callers

nothing calls this directly

Calls 3

frontMethod · 0.80
emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected