Polymorphic adaptor of a model of Executor to an executor. More...
#include <executor_adaptor.hpp>
Public Types | |
typedef executor::work | work |
type-erasure to store the works to do More... | |
Public Member Functions | |
template<typename... Args> | |
executor_adaptor (BOOST_THREAD_RV_REF(Args)...args) | |
executor is not copyable. More... | |
Executor & | underlying_executor () |
void | close () |
Effects: close the executor for submissions. More... | |
bool | closed () |
Returns: whether the pool is closed for submissions. More... | |
void | submit (BOOST_THREAD_RV_REF(work) closure) |
Effects: The specified closure will be scheduled for execution at some point in the future. More... | |
void | submit (void(*closure)()) |
template<typename Closure > | |
void | submit (BOOST_THREAD_RV_REF(Closure) closure) |
bool | try_executing_one () |
Effects: try to execute one task. More... | |
template<typename Pred > | |
bool | reschedule_until (Pred const &pred) |
Polymorphic adaptor of a model of Executor to an executor.
typedef executor::work boost::executors::executor_adaptor< Executor >::work |
type-erasure to store the works to do
|
inline |
executor is not copyable.
executor_adaptor constructor
|
inlinevirtual |
Effects: close the executor
for submissions.
The worker threads will work until there is no more closures to run.
Implements boost::executors::executor.
|
inlinevirtual |
Returns: whether the pool is closed for submissions.
Implements boost::executors::executor.
|
inlineinherited |
References boost::executors::executor::try_executing_one().
|
inlinevirtual |
Effects: The specified closure will be scheduled for execution at some point in the future.
If invoked closure throws an exception the executor 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.
Implements boost::executors::executor.
References boost::move().
Referenced by boost::executors::executor_adaptor< Executor >::submit().
|
inline |
|
inline |
|
inlinevirtual |
Effects: try to execute one task.
Returns: whether a task has been executed. Throws: whatever the current task constructor throws or the task() throws.
Implements boost::executors::executor.
|
inline |