Add lock guard to getNumberOfWorkers()

This commit is contained in:
Simon 2016-09-07 21:48:49 -07:00
parent e91048f28d
commit a50fd5fdb7
1 changed files with 1 additions and 0 deletions

View File

@ -183,6 +183,7 @@ void AsyncRPCQueue::addWorker() {
* Return the number of worker threads spawned by the queue * Return the number of worker threads spawned by the queue
*/ */
size_t AsyncRPCQueue::getNumberOfWorkers() const { size_t AsyncRPCQueue::getNumberOfWorkers() const {
std::lock_guard<std::mutex> guard(lock_);
return workers_.size(); return workers_.size();
} }