From: Pan Liu Date: Tue, 25 Apr 2017 10:05:20 +0000 (+0800) Subject: src/common: change last_work_queue to next_work_queue. X-Git-Tag: v12.0.3~244^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=60f4e0e4522940b7f0c42930160ae8fa22725576;p=ceph.git src/common: change last_work_queue to next_work_queue. Signed-off-by: Pan Liu --- diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index b74763901bf..ec5f8a1476d 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -39,7 +39,6 @@ ThreadPool::ThreadPool(CephContext *cct_, string nm, string tn, int n, const cha ioprio_class(-1), ioprio_priority(-1), _num_threads(n), - last_work_queue(0), processing(0) { if (option) { @@ -117,9 +116,8 @@ void ThreadPool::worker(WorkThread *wt) int tries = work_queues.size(); bool did = false; while (tries--) { - last_work_queue++; - last_work_queue %= work_queues.size(); - wq = work_queues[last_work_queue]; + next_work_queue %= work_queues.size(); + wq = work_queues[next_work_queue++]; void *item = wq->_void_dequeue(); if (item) { diff --git a/src/common/WorkQueue.h b/src/common/WorkQueue.h index d67d84ef7fa..6e29da6fd38 100644 --- a/src/common/WorkQueue.h +++ b/src/common/WorkQueue.h @@ -434,7 +434,7 @@ public: }; private: vector work_queues; - int last_work_queue; + int next_work_queue = 0; // threads