Class ThreadPoolExecutor

Inheritance Relationships

Base Type

Class Documentation

class ThreadPoolExecutor : public mir::NonBlockingExecutor

Public Functions

virtual void spawn(std::function<void()> &&work) override

Schedule some function to be called sometime in the future.

It is expected that this not eagerly execute, and will return before work() is executed.

Parameters:

work[in] Function to execute in Executor specified environment.

Public Static Functions

static void set_unhandled_exception_handler(void (*handler)())

Set a handler to be called should an unhandled exception occur on the ThreadPoolExecutor.

By default the ThreadPoolExecutor will allow exceptions to propagate, resulting in process termination.

Parameters:

handler – [in] A handler that will be called in exception context should an exception escape any functor executed by spawn. This handler will be called on an unspecified thread.

static void quiesce()

Wait for all current work to finish and terminate all worker threads.

Protected Functions

ThreadPoolExecutor() = default