]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/common: change last_work_queue to next_work_queue.
authorPan Liu <liupan1111@gmail.com>
Tue, 25 Apr 2017 10:05:20 +0000 (18:05 +0800)
committerPan Liu <liupan1111@gmail.com>
Tue, 25 Apr 2017 10:05:20 +0000 (18:05 +0800)
Signed-off-by: Pan Liu <liupan1111@gmail.com>
src/common/WorkQueue.cc
src/common/WorkQueue.h

index b74763901bfe3cf4d968c8b1721fed8ef6b84311..ec5f8a1476d1f0cbe5a7928c444f94cc9d9576f9 100644 (file)
@@ -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) {
index d67d84ef7faeee26f3544ddedb36282f6a9558e9..6e29da6fd380b6a4cd44d310bc3720d9edafe4e6 100644 (file)
@@ -434,7 +434,7 @@ public:
   };
 private:
   vector<WorkQueue_*> work_queues;
-  int last_work_queue;
+  int next_work_queue = 0;
  
 
   // threads