Implements thread scheduler that assigns jobs up to maximum number of threads allowed. More...
#include <thread_pool.hpp>
Classes | |
struct | ThreadsArray |
Structure to keep status of threads in the pool. More... | |
Public Member Functions | |
unsigned int | go (const boost::function0< void > &threadfunc) |
void | join_all () |
unsigned int | get_running_threads () const |
Private Types | |
typedef boost::scoped_ptr < boost::thread > | ThreadPtr |
Private Member Functions | |
void | launch_thread (const boost::function0< void > &threadfunc, unsigned int threadsid) |
Private Attributes | |
ThreadsArray | threads [max_threads] |
unsigned int | _running_threads |
boost::mutex | mutex_launcher |
boost::condition | cond_launcher |
Static Private Attributes | |
static unsigned int | idx = 0 |
Implements thread scheduler that assigns jobs up to maximum number of threads allowed.