MCPcopy Create free account
hub / github.com/apache/singa / Pop

Method Pop

include/singa/utils/safe_queue.h:56–61  ·  view source on GitHub ↗

* Pop an element from the queue. * It will be blocked until one element is poped. */

Source from the content-addressed store, hash-verified

54 * It will be blocked until one element is poped.
55 */
56 void Pop(T& e) {
57 std::unique_lock<std::mutex> lock(mutex_);
58 condition_.wait(lock, [this]() { return !queue_.empty(); });
59 e = queue_.front();
60 queue_.pop();
61 }
62 /**
63 * Pop an item from the queue until one element is poped or timout.
64 * @param[in] timeout, return false after waiting this number of microseconds

Callers 3

RunGraphMethod · 0.45
AnalyzeNodesMethod · 0.45
FreeLoopMethod · 0.45

Calls 2

emptyMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected