22 #ifndef Hypertable_Lib_TableMutatorCompletionCounter_h
23 #define Hypertable_Lib_TableMutatorCompletionCounter_h
27 #include <condition_variable>
44 void set(
size_t count) {
45 std::unique_lock<std::mutex> lock(
m_mutex);
52 std::unique_lock<std::mutex> lock(
m_mutex);
63 std::unique_lock<std::mutex> lock(
m_mutex);
67 auto expire_time = std::chrono::system_clock::now() +
68 std::chrono::milliseconds(timer.
remaining());
70 if (!
m_cond.wait_until(lock, expire_time,
71 [
this](){ return m_outstanding == 0; }))
78 std::unique_lock<std::mutex> lock(
m_mutex);
106 #endif // Hypertable_Lib_TableMutatorCompletionCounter_h
Tracks outstanding RangeServer update requests.
uint32_t remaining()
Returns the remaining time till expiry.
Time related declarations.
std::condition_variable m_cond
void start()
Starts the timer.
A timer class to keep timeout states across AsyncComm related calls.
bool wait_for_completion()
bool wait_for_completion(Timer &timer)
#define HT_THROW(_code_, _msg_)
TableMutatorCompletionCounter()