diff --git a/src/common/WorkQueue.h b/src/common/WorkQueue.h index 300ae7d7d71800..ef6991b4569d73 100644 --- a/src/common/WorkQueue.h +++ b/src/common/WorkQueue.h @@ -340,10 +340,12 @@ class ThreadPool : public md_config_obs_t { /// assign a work queue to this thread pool void add_work_queue(WorkQueue_* wq) { + Mutex::Locker l(_lock); work_queues.push_back(wq); } /// remove a work queue from this thread pool void remove_work_queue(WorkQueue_* wq) { + Mutex::Locker l(_lock); unsigned i = 0; while (work_queues[i] != wq) i++;