This class provides the same interface as AsyncExecutor
but allows in a thread-safe manner invalidate internally held implementation of AsyncExecutor
.
More...
#include <AsyncExecutor.h>
Public Member Functions | |
OptionalAsyncExecutor () | |
Contructor. More... | |
void | Dispatch (const std::function< void()> &call) |
Creates a new thread in which the call will be executed. More... | |
void | Invalidate () |
Destroys internally held AsyncExecutor , any subsequent calls of Dispatch have no effect. | |
This class provides the same interface as AsyncExecutor
but allows in a thread-safe manner invalidate internally held implementation of AsyncExecutor
.
Any subsequent calls of Dispatch
have no effect, what allows to safely share AsyncExecutor
but control it's operability.
|
inline |
Contructor.
Initially constructed the class behaves as AsyncExecutor
.
|
inline |
Creates a new thread in which the call
will be executed.
call | is a function object which is called within a worker thread, different from the caller thread. There is no effect if call is empty or if Invalidate had been already called. |