MCPcopy Create free account
hub / github.com/ChunelFeng/CThreadPool / waitPop

Function waitPop

src/UtilsCtrl/ThreadPool/Queue/UAtomicQueue.h:80–86  ·  view source on GitHub ↗

* 阻塞式等待弹出 * @return */

Source from the content-addressed store, hash-verified

78 * @return
79 */
80 std::unique_ptr<T> waitPop() {
81 CGRAPH_UNIQUE_LOCK lk(mutex_);
82 cv_.wait(lk, [this] { return !queue_.empty(); });
83 std::unique_ptr<T> result = std::move(queue_.front());
84 queue_.pop();
85 return result;
86 }
87
88
89 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected