Warning, file /include/boost/thread/thread_guard.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef BOOST_THREAD_THREAD_GUARD_HPP
0010 #define BOOST_THREAD_THREAD_GUARD_HPP
0011
0012 #include <boost/thread/detail/delete.hpp>
0013 #include <boost/thread/detail/move.hpp>
0014 #include <boost/thread/thread_functors.hpp>
0015 #include <boost/thread/detail/thread_interruption.hpp>
0016
0017 #include <boost/config/abi_prefix.hpp>
0018
0019 namespace boost
0020 {
0021
0022
0023
0024
0025 template <class CallableThread = join_if_joinable, class Thread=::boost::thread>
0026 class thread_guard
0027 {
0028 Thread& t_;
0029 public:
0030 BOOST_THREAD_NO_COPYABLE( thread_guard)
0031
0032 explicit thread_guard(Thread& t) :
0033 t_(t)
0034 {
0035 }
0036 ~thread_guard()
0037 {
0038 #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
0039
0040 boost::this_thread::disable_interruption do_not_disturb;
0041 #endif
0042 CallableThread on_destructor;
0043
0044 on_destructor(t_);
0045 }
0046 };
0047
0048 }
0049 #include <boost/config/abi_suffix.hpp>
0050
0051 #endif