Ability to get size of messages queue of async thread pool

This commit is contained in:
Могилин Виктор
2020-11-13 13:12:32 +03:00
parent 18e3f07f7d
commit e17ee87f38
3 changed files with 12 additions and 0 deletions

View File

@@ -110,6 +110,12 @@ public:
return q_.overrun_counter();
}
size_t size()
{
std::unique_lock<std::mutex> lock(queue_mutex_);
return q_.size();
}
private:
std::mutex queue_mutex_;
std::condition_variable push_cv_;