Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/thread/executors/scheduling_adaptor.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | f46d142149f5 |
children |
rev | line source |
---|---|
Chris@102 | 1 // Copyright (C) 2014 Ian Forbed |
Chris@102 | 2 // Copyright (C) 2014 Vicente J. Botet Escriba |
Chris@102 | 3 // |
Chris@102 | 4 // Distributed under the Boost Software License, Version 1.0. (See accompanying |
Chris@102 | 5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@102 | 6 // |
Chris@102 | 7 |
Chris@102 | 8 #ifndef BOOST_THREAD_EXECUTORS_SCHEDULING_ADAPTOR_HPP |
Chris@102 | 9 #define BOOST_THREAD_EXECUTORS_SCHEDULING_ADAPTOR_HPP |
Chris@102 | 10 |
Chris@102 | 11 #include <boost/thread/executors/detail/scheduled_executor_base.hpp> |
Chris@102 | 12 |
Chris@102 | 13 namespace boost |
Chris@102 | 14 { |
Chris@102 | 15 namespace executors |
Chris@102 | 16 { |
Chris@102 | 17 |
Chris@102 | 18 template <typename Executor> |
Chris@102 | 19 class scheduling_adpator : public detail::scheduled_executor_base<> |
Chris@102 | 20 { |
Chris@102 | 21 private: |
Chris@102 | 22 Executor& _exec; |
Chris@102 | 23 thread _scheduler; |
Chris@102 | 24 public: |
Chris@102 | 25 |
Chris@102 | 26 scheduling_adpator(Executor& ex) |
Chris@102 | 27 : super(), |
Chris@102 | 28 _exec(ex), |
Chris@102 | 29 _scheduler(&super::loop, this) {} |
Chris@102 | 30 |
Chris@102 | 31 ~scheduling_adpator() |
Chris@102 | 32 { |
Chris@102 | 33 this->close(); |
Chris@102 | 34 _scheduler.join(); |
Chris@102 | 35 } |
Chris@102 | 36 |
Chris@102 | 37 Executor& underlying_executor() |
Chris@102 | 38 { |
Chris@102 | 39 return _exec; |
Chris@102 | 40 } |
Chris@102 | 41 |
Chris@102 | 42 private: |
Chris@102 | 43 typedef detail::scheduled_executor_base<> super; |
Chris@102 | 44 }; //end class |
Chris@102 | 45 |
Chris@102 | 46 } //end executors |
Chris@102 | 47 |
Chris@102 | 48 using executors::scheduling_adpator; |
Chris@102 | 49 |
Chris@102 | 50 } //end boost |
Chris@102 | 51 #endif |