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

Method wait_and_pop

src/util/threadsafe_queue.h:25–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 void wait_and_pop(T& value) {
26 std::unique_lock<std::mutex> lk(mut);
27 data_cond.wait(lk, [this]{return !data_queue.empty();});
28 value = std::move(data_queue.front());
29 data_queue.pop();
30 }
31
32 std::shared_ptr<T> wait_and_pop() {
33 std::unique_lock<std::mutex> lk(mut);

Callers 1

sendMethod · 0.80

Calls 4

waitMethod · 0.80
frontMethod · 0.80
emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected