#include <threadpool.h>
Public Member Functions | |
ThreadPool (ushort_t count=1) | |
virtual | ~ThreadPool () |
bool | Run (Thread::ThreadFun fun, void *data=NULL) |
void | Wait (bool all_requests=true) |
void | Kill () |
Private Types | |
typedef std::vector < Thread * > ::size_type | threads_pos_t |
Private Member Functions | |
Request | GetRequest () |
Static Private Member Functions | |
static void | StartThread (void *data) |
Private Attributes | |
vector< Thread * > | threads |
list< Request > | requests |
Mutex * | mutex |
Condition * | request_cond |
bool | can_run |
Classes | |
struct | Request |
typedef std::vector<Thread *>::size_type ThreadPool::threads_pos_t [private] |
ThreadPool::ThreadPool | ( | ushort_t | count = 1 |
) | [inline] |
ThreadPool::~ThreadPool | ( | ) | [inline, virtual] |
bool ThreadPool::Run | ( | Thread::ThreadFun | fun, | |
void * | data = NULL | |||
) | [inline] |
void ThreadPool::Wait | ( | bool | all_requests = true |
) | [inline] |
void ThreadPool::Kill | ( | ) | [inline] |
void ThreadPool::StartThread | ( | void * | data | ) | [inline, static, private] |
ThreadPool::Request ThreadPool::GetRequest | ( | ) | [inline, private] |
vector<Thread *> ThreadPool::threads [private] |
list<Request> ThreadPool::requests [private] |
Mutex* ThreadPool::mutex [private] |
Condition* ThreadPool::request_cond [private] |
bool ThreadPool::can_run [private] |