Pops the last item from the queue but waits if the queue is empty until new items are pushed.
| 34 | // Pops the last item from the queue but waits if the queue is empty until new items are |
| 35 | // pushed. |
| 36 | T WaitAndPop() { |
| 37 | std::unique_lock<std::mutex> lock(mutex_); |
| 38 | WaitUntilNonEmpty(lock); |
| 39 | return PopUnlocked(); |
| 40 | } |
| 41 | |
| 42 | // Pops the last item from the queue, or returns a nullopt if empty |
| 43 | std::optional<T> TryPop() { |
no outgoing calls