thread_pool::thread_pool Class Reference

#include <thread_pool.hpp>

Public Member Functions

 thread_pool (std::size_t nrthreads=0)
 
 ~thread_pool ()
 
std::size_t size () const
 
void resize (std::size_t nrthreads)
 
template<typename F , typename... Args>
auto enqueue (F &&f, Args &&... args) -> std::future< typename detail::result_of< F(Args...)>::type >
 
void push (const std::function< void()> &f)
 
void push (std::function< void()> &&f)
 
void stop ()
 
bool work ()
 
void wait_work ()
 
void wait_sleep ()
 
void run (const std::function< void()> &f, int threads=-1)
 
void run (const std::function< void(int)> &f, int threads=-1)
 
void run (const std::function< void(int, int)> &f, int threads=-1)
 

Constructor & Destructor Documentation

◆ thread_pool()

thread_pool::thread_pool::thread_pool ( std::size_t  nrthreads = 0)
inline

◆ ~thread_pool()

thread_pool::thread_pool::~thread_pool ( )
inline

Member Function Documentation

◆ enqueue()

template<typename F , typename... Args>
auto thread_pool::thread_pool::enqueue ( F &&  f,
Args &&...  args 
) -> std::future<typename detail::result_of<F(Args...)>::type>
inline

◆ push() [1/2]

void thread_pool::thread_pool::push ( const std::function< void()> &  f)
inline

◆ push() [2/2]

void thread_pool::thread_pool::push ( std::function< void()> &&  f)
inline

◆ resize()

void thread_pool::thread_pool::resize ( std::size_t  nrthreads)
inline

◆ run() [1/3]

void thread_pool::thread_pool::run ( const std::function< void()> &  f,
int  threads = -1 
)
inline

◆ run() [2/3]

void thread_pool::thread_pool::run ( const std::function< void(int)> &  f,
int  threads = -1 
)
inline

◆ run() [3/3]

void thread_pool::thread_pool::run ( const std::function< void(int, int)> &  f,
int  threads = -1 
)
inline

◆ size()

std::size_t thread_pool::thread_pool::size ( ) const
inline

◆ stop()

void thread_pool::thread_pool::stop ( )
inline

◆ wait_sleep()

void thread_pool::thread_pool::wait_sleep ( )
inline

◆ wait_work()

void thread_pool::thread_pool::wait_work ( )
inline

◆ work()

bool thread_pool::thread_pool::work ( )
inline

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