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