]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
WorkQueue: PointerWQ now supports out-of-band processing
authorJason Dillaman <dillaman@redhat.com>
Thu, 10 Dec 2015 23:38:34 +0000 (18:38 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 15 Dec 2015 01:31:31 +0000 (20:31 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/common/WorkQueue.h

index 7c3ccb5c5c2693c1ff0107f93f8fb15186aa79cd..a6e7972408f62a476649a35c2362373f4918b425 100644 (file)
@@ -411,6 +411,10 @@ public:
     }
 
     virtual void process(T *item) = 0;
+    void process_finish() {
+      Mutex::Locker locker(m_pool->_lock);
+      _void_process_finish(nullptr);
+    }
 
     T *front() {
       assert(m_pool->_lock.is_locked());
@@ -423,6 +427,9 @@ public:
       Mutex::Locker pool_locker(m_pool->_lock);
       m_pool->_cond.SignalOne();
     }
+    Mutex &get_pool_lock() {
+      return m_pool->_lock;
+    }
   private:
     ThreadPool *m_pool;
     std::list<T *> m_items;