16 #ifndef IMPALA_UTIL_BLOCKING_QUEUE_H
17 #define IMPALA_UTIL_BLOCKING_QUEUE_H
19 #include <boost/thread/condition_variable.hpp>
20 #include <boost/thread/mutex.hpp>
48 boost::unique_lock<boost::mutex> unique_lock(
lock_);
71 boost::unique_lock<boost::mutex> unique_lock(
lock_);
91 boost::lock_guard<boost::mutex> guard(
lock_);
100 boost::unique_lock<boost::mutex> l(
lock_);
106 boost::lock_guard<boost::mutex> guard(
lock_);
112 boost::lock_guard<boost::mutex> guard(
lock_);
uint64_t total_get_wait_time() const
Returns the total amount of time threads have blocked in BlockingGet.
boost::condition_variable get_cv_
uint64_t total_put_wait_time() const
Returns the total amount of time threads have blocked in BlockingPut.
bool BlockingPut(const T &val)
uint64_t total_put_wait_time_
BlockingQueue(size_t max_elements)
uint64_t ElapsedTime() const
Returns time in nanosecond.
uint64_t total_get_wait_time_
boost::condition_variable put_cv_
void Shutdown()
Shut down the queue. Wakes up all threads waiting on BlockingGet or BlockingPut.
boost::mutex lock_
lock_ guards access to list_, total_get_wait_time, and total_put_wait_time