Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::strict_scoped_thread< CallableThread > Class Template Reference

RAI thread wrapper adding a specific destroyer allowing to master what can be done at destruction time. More...

#include <scoped_thread.hpp>

Public Member Functions

 BOOST_THREAD_NO_COPYABLE (strict_scoped_thread) template< class F
 non copyable More...
 

Detailed Description

template<class CallableThread = join_if_joinable>
class boost::strict_scoped_thread< CallableThread >

RAI thread wrapper adding a specific destroyer allowing to master what can be done at destruction time.

CallableThread: A callable void(thread&) . The default is a join_if_joinable.

thread std/boost::thread destructor terminates the program if the thread is not joinable. Having a wrapper that can join the thread before destroying it seems a natural need.

Example:

boost::strict_scoped_thread<> t((boost::thread(F)));

Member Function Documentation

template<class CallableThread = join_if_joinable>
boost::strict_scoped_thread< CallableThread >::BOOST_THREAD_NO_COPYABLE ( strict_scoped_thread< CallableThread >  )

non copyable


The documentation for this class was generated from the following file: