Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/thread/thread_functors.hpp @ 125:34e428693f5d vext
Vext -> Repoint
author | Chris Cannam |
---|---|
date | Thu, 14 Jun 2018 11:15:39 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 // Distributed under the Boost Software License, Version 1.0. (See |
Chris@16 | 2 // accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 3 // http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 4 // (C) Copyright 2009-2012 Anthony Williams |
Chris@16 | 5 // (C) Copyright 2012 Vicente J. Botet Escriba |
Chris@16 | 6 |
Chris@16 | 7 // Based on the Anthony's idea of scoped_thread in CCiA |
Chris@16 | 8 |
Chris@16 | 9 #ifndef BOOST_THREAD_THREAD_FUNCTORS_HPP |
Chris@16 | 10 #define BOOST_THREAD_THREAD_FUNCTORS_HPP |
Chris@16 | 11 |
Chris@16 | 12 #include <boost/thread/detail/config.hpp> |
Chris@16 | 13 #include <boost/thread/detail/delete.hpp> |
Chris@16 | 14 #include <boost/thread/detail/move.hpp> |
Chris@16 | 15 #include <boost/thread/thread_only.hpp> |
Chris@16 | 16 |
Chris@16 | 17 #include <boost/config/abi_prefix.hpp> |
Chris@16 | 18 |
Chris@16 | 19 namespace boost |
Chris@16 | 20 { |
Chris@16 | 21 |
Chris@16 | 22 struct detach |
Chris@16 | 23 { |
Chris@16 | 24 void operator()(thread& t) |
Chris@16 | 25 { |
Chris@16 | 26 t.detach(); |
Chris@16 | 27 } |
Chris@16 | 28 }; |
Chris@16 | 29 |
Chris@16 | 30 struct join_if_joinable |
Chris@16 | 31 { |
Chris@16 | 32 void operator()(thread& t) |
Chris@16 | 33 { |
Chris@16 | 34 if (t.joinable()) |
Chris@16 | 35 { |
Chris@16 | 36 t.join(); |
Chris@16 | 37 } |
Chris@16 | 38 } |
Chris@16 | 39 }; |
Chris@16 | 40 |
Chris@16 | 41 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS |
Chris@16 | 42 struct interrupt_and_join_if_joinable |
Chris@16 | 43 { |
Chris@16 | 44 void operator()(thread& t) |
Chris@16 | 45 { |
Chris@16 | 46 t.interrupt(); |
Chris@16 | 47 if (t.joinable()) |
Chris@16 | 48 { |
Chris@16 | 49 t.join(); |
Chris@16 | 50 } |
Chris@16 | 51 } |
Chris@16 | 52 }; |
Chris@16 | 53 #endif |
Chris@16 | 54 } |
Chris@16 | 55 #include <boost/config/abi_suffix.hpp> |
Chris@16 | 56 |
Chris@16 | 57 #endif |