Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::executors::generic_executor_ref Class Reference

#include <generic_executor_ref.hpp>

Public Types

typedef executors::work work
 type-erasure to store the works to do More...
 

Public Member Functions

template<typename Executor >
 generic_executor_ref (Executor &ex)
 
void close ()
 
bool closed ()
 
void submit (BOOST_THREAD_RV_REF(work) closure)
 
void submit (void(*closure)())
 
template<typename Closure >
void submit (BOOST_THREAD_RV_REF(Closure) closure)
 
bool try_executing_one ()
 
template<typename Pred >
bool reschedule_until (Pred const &pred)
 

Member Typedef Documentation

type-erasure to store the works to do

Constructor & Destructor Documentation

template<typename Executor >
boost::executors::generic_executor_ref::generic_executor_ref ( Executor &  ex)
inline

Member Function Documentation

void boost::executors::generic_executor_ref::close ( )
inline
Effects
Close the executor for submissions. The worker threads will work until there is no more closures to run.
bool boost::executors::generic_executor_ref::closed ( )
inline
Returns
Whether the pool is closed for submissions.
template<typename Pred >
bool boost::executors::generic_executor_ref::reschedule_until ( Pred const &  pred)
inline
Requires
This must be called from an scheduled task.
Effects
reschedule functions until pred()

References try_executing_one().

void boost::executors::generic_executor_ref::submit ( BOOST_THREAD_RV_REF(work closure)
inline
void boost::executors::generic_executor_ref::submit ( void(*)()  closure)
inline
Requires
Closure is a model of Callable(void()) and a model of CopyConstructible/MoveConstructible.
Effects
The specified closure will be scheduled for execution at some point in the future. If invoked closure throws an exception the thread pool will call std::terminate, as is the case with threads.
Synchronization
Completion of closure on a particular thread happens before destruction of thread's thread local variables.
Throws
sync_queue_is_closed if the thread pool is closed. Whatever exception that can be throw while storing the closure.

References boost::move(), and submit().

template<typename Closure >
void boost::executors::generic_executor_ref::submit ( BOOST_THREAD_RV_REF(Closure)  closure)
inline

References boost::move(), and submit().

bool boost::executors::generic_executor_ref::try_executing_one ( )
inline
Effects
Try to execute one task.
Returns
Whether a task has been executed.
Throws
Whatever the current task constructor throws or the task() throws.

Referenced by reschedule_until().


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