00001
00019 #ifndef THREADPOOL_SHUTDOWN_POLICIES_HPP_INCLUDED
00020 #define THREADPOOL_SHUTDOWN_POLICIES_HPP_INCLUDED
00021
00022
00023
00025 namespace boost { namespace threadpool
00026 {
00027
00028
00034 template<typename Pool>
00035 class wait_for_all_tasks
00036 {
00037 public:
00038 static void shutdown(Pool& pool)
00039 {
00040 pool.wait();
00041 pool.terminate_all_workers(true);
00042 }
00043 };
00044
00045
00051 template<typename Pool>
00052 class wait_for_active_tasks
00053 {
00054 public:
00055 static void shutdown(Pool& pool)
00056 {
00057 pool.clear();
00058 pool.wait();
00059 pool.terminate_all_workers(true);
00060 }
00061 };
00062
00063
00070 template<typename Pool>
00071 class immediately
00072 {
00073 public:
00074 static void shutdown(Pool& pool)
00075 {
00076 pool.clear();
00077 pool.terminate_all_workers(false);
00078 }
00079 };
00080
00081 } }
00082
00083 #endif // THREADPOOL_SHUTDOWN_POLICIES_HPP_INCLUDED