1 // Copyright (C) 2014 Ian Forbed
2 // Copyright (C) 2014 Vicente J. Botet Escriba
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_THREAD_EXECUTORS_DETAIL_PRIORITY_EXECUTOR_BASE_HPP
9 #define BOOST_THREAD_EXECUTORS_DETAIL_PRIORITY_EXECUTOR_BASE_HPP
11 #include <boost/atomic.hpp>
12 #include <boost/function.hpp>
13 #include <boost/thread/thread.hpp>
14 #include <boost/thread/concurrent_queues/sync_timed_queue.hpp>
15 #include <boost/thread/executors/work.hpp>
23 template <class Queue>
24 class priority_executor_base
27 //typedef boost::function<void()> work;
28 typedef executors::work_pq work;
30 typedef Queue queue_type;
33 priority_executor_base() {}
36 ~priority_executor_base()
51 return _workq.closed();
62 queue_op_status st = _workq.wait_pull(task);
63 if (st == queue_op_status::closed) return;
66 catch (boost::thread_interrupted&)
80 } //end detail namespace
81 } //end executors namespace
82 } //end boost namespace