libadblockplus
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
AdblockPlus::OptionalAsyncExecutor Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

AdblockPlus::OptionalAsyncExecutor::OptionalAsyncExecutor ( )
inline

Contructor.

Initially constructed the class behaves as AsyncExecutor.

Member Function Documentation

void AdblockPlus::OptionalAsyncExecutor::Dispatch ( const std::function< void()> &  call)
inline

Creates a new thread in which the call will be executed.

Parameters
callis 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.

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