| 46 | |
| 47 | template<typename T> |
| 48 | T BlockingQueue<T>::pop(const string& log_on_wait) { |
| 49 | boost::mutex::scoped_lock lock(sync_->mutex_); |
| 50 | |
| 51 | while (queue_.empty()) { |
| 52 | if (!log_on_wait.empty()) { |
| 53 | LOG_EVERY_N(INFO, 1000)<< log_on_wait; |
| 54 | } |
| 55 | sync_->condition_.wait(lock); |
| 56 | } |
| 57 | |
| 58 | T t = queue_.front(); |
| 59 | queue_.pop(); |
| 60 | return t; |
| 61 | } |
| 62 | |
| 63 | template<typename T> |
| 64 | bool BlockingQueue<T>::try_peek(T* t) { |
no outgoing calls
no test coverage detected