The Gaudi Framework  v29r0 (ff2e7097)
shutdown_policies.hpp
Go to the documentation of this file.
1 
19 #ifndef THREADPOOL_SHUTDOWN_POLICIES_HPP_INCLUDED
20 #define THREADPOOL_SHUTDOWN_POLICIES_HPP_INCLUDED
21 
22 
23 
25 namespace boost { namespace threadpool
26 {
27 
28 
34  template<typename Pool>
36  {
37  public:
38  static void shutdown(Pool& pool)
39  {
40  pool.wait();
41  pool.terminate_all_workers(true);
42  }
43  };
44 
45 
51  template<typename Pool>
53  {
54  public:
55  static void shutdown(Pool& pool)
56  {
57  pool.clear();
58  pool.wait();
59  pool.terminate_all_workers(true);
60  }
61  };
62 
63 
70  template<typename Pool>
72  {
73  public:
74  static void shutdown(Pool& pool)
75  {
76  pool.clear();
77  pool.terminate_all_workers(false);
78  }
79  };
80 
81 } } // namespace boost::threadpool
82 
83 #endif // THREADPOOL_SHUTDOWN_POLICIES_HPP_INCLUDED
static void shutdown(Pool &pool)
ShutdownPolicy which waits for the completion of all tasks and the worker termination afterwards...
The namespace threadpool contains a thread pool and related utility classes.
Definition: iter_pos.hpp:13
ShutdownPolicy which does not wait for any tasks or worker termination.
ShutdownPolicy which waits for the completion of all active tasks and the worker termination afterwar...