Skip to content

thread_task_executor

Dmitry Koplyarov edited this page Feb 29, 2016 · 6 revisions

Back to reference

template < typename ExceptionHandlingPolicy_ = exception_handling::default_ >
class basic_thread_task_executor : public task_executor
{
public:
	template < typename... Args_ >
	basic_thread_task_executor(Args_&... args);

	void add_task(const std::function<void()>& task);
};

using thread_task_executor = basic_thread_task_executor<>;

Table of contents

Constructors

variadic arguments constructor

template < typename... Args_ >
basic_thread_task_executor(Args_&... args);

Forwards the arguments to the exception_handling policy constructor.

Methods

add_task

void add_task(const std::function<void()>& task);

Puts a task into a queue.

Thread safety: This is a thread-safe method.

Arguments:

  • task - an std::function that should be executed in the task_executor

Clone this wiki locally