removed wait_empty() from tp and q

This commit is contained in:
gabime
2018-06-01 17:25:23 +03:00
parent 7f6220d960
commit 7815d39807
3 changed files with 5 additions and 14 deletions

View File

@@ -71,13 +71,7 @@ public:
pop_cv_.notify_one();
return true;
}
// wait until the queue is empty
void wait_empty()
{
std::unique_lock<std::mutex> lock(queue_mutex_);
pop_cv_.wait(lock, [this] { return this->q_.empty(); });
}
private:
size_t max_items_;

View File

@@ -138,11 +138,7 @@ public:
{
return msg_counter_.load(std::memory_order_relaxed);
}
void wait_empty()
{
q_.wait_empty();
}
private:
std::atomic<size_t> msg_counter_; // total # of messages processed in this pool