MeVisLab Toolbox Reference
asio::ThreadPool Class Reference

A thread pool executing an asio::Context's run method with a bunch of threads. More...

#include <ThreadPool.h>

Public Member Functions

 ThreadPool (std::shared_ptr< Context > context, const unsigned short num_threads)
 
 ~ThreadPool ()
 
 ThreadPool (const ThreadPool &)=delete
 
ThreadPooloperator= (const ThreadPool &)=delete
 

Detailed Description

A thread pool executing an asio::Context's run method with a bunch of threads.

Synopsis:

auto context = std::make_shared<asio::Context>();
ThreadPool pool{ context, 5 };
// While the pool is living, its threads are executing the context's run method. On destruction, work is removed and the threads are joined.
ThreadPool(std::shared_ptr< Context > context, const unsigned short num_threads)

Definition at line 28 of file ThreadPool.h.

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

asio::ThreadPool::ThreadPool ( std::shared_ptr< Context context,
const unsigned short  num_threads 
)

◆ ~ThreadPool()

asio::ThreadPool::~ThreadPool ( )

◆ ThreadPool() [2/2]

asio::ThreadPool::ThreadPool ( const ThreadPool )
delete

Member Function Documentation

◆ operator=()

ThreadPool& asio::ThreadPool::operator= ( const ThreadPool )
delete

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