Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
ThreadPool Class Reference

A simple thread pool that pulls tasks off its queue in FIFO order. More...

#include <ThreadPool.h>

Public Member Functions

 ThreadPool (std::size_t numThreads)
 Constructs a thread pool with numThreads threads.
 
 ~ThreadPool ()
 Finishes all tasks currently in the queue.
 
void add (std::function< void()> task)
 
 ThreadPool (std::size_t numThreads)
 Constructs a thread pool with numThreads threads.
 
 ~ThreadPool ()
 Finishes all tasks currently in the queue.
 
void add (std::function< void()> task)
 
 ThreadPool (std::size_t numThreads)
 Constructs a thread pool with numThreads threads.
 
 ~ThreadPool ()
 Finishes all tasks currently in the queue.
 
void add (std::function< void()> task)
 

Detailed Description

A simple thread pool that pulls tasks off its queue in FIFO order.

Constructor & Destructor Documentation

◆ ThreadPool() [1/3]

ThreadPool ( std::size_t numThreads)
inlineexplicit

Constructs a thread pool with numThreads threads.

◆ ~ThreadPool() [1/3]

~ThreadPool ( )
inline

Finishes all tasks currently in the queue.

◆ ThreadPool() [2/3]

ThreadPool ( std::size_t numThreads)
inlineexplicit

Constructs a thread pool with numThreads threads.

◆ ~ThreadPool() [2/3]

~ThreadPool ( )
inline

Finishes all tasks currently in the queue.

◆ ThreadPool() [3/3]

ThreadPool ( std::size_t numThreads)
inlineexplicit

Constructs a thread pool with numThreads threads.

◆ ~ThreadPool() [3/3]

~ThreadPool ( )
inline

Finishes all tasks currently in the queue.

Member Function Documentation

◆ add() [1/3]

void add ( std::function< void()> task)
inline

Adds task to the queue of tasks to execute. Since task is a std::function<>, it cannot be a move only type. So any lambda passed must not capture move only types (like std::unique_ptr).

Parameters
taskThe task to execute.

◆ add() [2/3]

void add ( std::function< void()> task)
inline

Adds task to the queue of tasks to execute. Since task is a std::function<>, it cannot be a move only type. So any lambda passed must not capture move only types (like std::unique_ptr).

Parameters
taskThe task to execute.

◆ add() [3/3]

void add ( std::function< void()> task)
inline

Adds task to the queue of tasks to execute. Since task is a std::function<>, it cannot be a move only type. So any lambda passed must not capture move only types (like std::unique_ptr).

Parameters
taskThe task to execute.

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