]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/thread/executors/basic_thread_pool.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / thread / executors / basic_thread_pool.hpp
index 365119d1a7ff32868362f1fa1c6724566945fd56..ef40ea0961040574ed44896b6d323cfe15bc02ab 100644 (file)
@@ -11,6 +11,8 @@
 #define BOOST_THREAD_EXECUTORS_BASIC_THREAD_POOL_HPP
 
 #include <boost/thread/detail/config.hpp>
+#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION && defined BOOST_THREAD_PROVIDES_EXECUTORS && defined BOOST_THREAD_USES_MOVE
+
 #include <boost/thread/detail/delete.hpp>
 #include <boost/thread/detail/move.hpp>
 #include <boost/thread/thread.hpp>
@@ -231,13 +233,36 @@ namespace executors
       // signal to all the worker threads that there will be no more submissions.
       close();
       // joins all the threads before destroying the thread pool resources (e.g. the queue).
-      join();
+      interrupt_and_join();
     }
 
     /**
      * \b Effects: join all the threads.
      */
     void join()
+    {
+      for (unsigned i = 0; i < threads.size(); ++i)
+      {
+        //threads[i].interrupt();
+        threads[i].join();
+      }
+    }
+
+    /**
+     * \b Effects: interrupt all the threads.
+     */
+    void interrupt()
+    {
+      for (unsigned i = 0; i < threads.size(); ++i)
+      {
+        threads[i].interrupt();
+      }
+    }
+
+    /**
+     * \b Effects: interrupt and join all the threads.
+     */
+    void interrupt_and_join()
     {
       for (unsigned i = 0; i < threads.size(); ++i)
       {
@@ -324,3 +349,4 @@ using executors::basic_thread_pool;
 #include <boost/config/abi_suffix.hpp>
 
 #endif
+#endif