Skip to content

Commit

Permalink
Merge pull request #5889: ThreadPool add/remove work queue methods no…
Browse files Browse the repository at this point in the history
…t thread safe

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
ldachary committed Oct 3, 2015
2 parents abc37f1 + d8ac510 commit 7309a06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/WorkQueue.h
Expand Up @@ -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++;
Expand Down

0 comments on commit 7309a06

Please sign in to comment.