* 非阻塞式等待弹出 * @return */
| 91 | * @return |
| 92 | */ |
| 93 | std::unique_ptr<T> tryPop() { |
| 94 | CGRAPH_LOCK_GUARD lk(mutex_); |
| 95 | if (queue_.empty()) { return std::unique_ptr<T>(); } |
| 96 | std::unique_ptr<T> ptr = std::move(queue_.front()); |
| 97 | queue_.pop(); |
| 98 | return ptr; |
| 99 | } |
| 100 | |
| 101 | |
| 102 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected