]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
WorkQueue: add ability to requeue an item that was dequeued
authorJason Dillaman <dillaman@redhat.com>
Fri, 8 Apr 2016 18:25:56 +0000 (14:25 -0400)
committerJason Dillaman <dillaman@redhat.com>
Sat, 9 Apr 2016 16:59:00 +0000 (12:59 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/common/WorkQueue.h

index 5ce695297e9d7d9eebd526b4452b1a352f02ad35..bffe12b58fae0558a3ff59523f72ce4771710af8 100644 (file)
@@ -414,6 +414,11 @@ public:
       }
       return m_items.front();
     }
+    void requeue(T *item) {
+      Mutex::Locker pool_locker(m_pool->_lock);
+      _void_process_finish(nullptr);
+      m_items.push_front(item);
+    }
     void signal() {
       Mutex::Locker pool_locker(m_pool->_lock);
       m_pool->_cond.SignalOne();