43 void add(
void *workItem);
53 static void *
worker (
void *);
59 void* (*workRoutine) (
void *);
pthread_mutex_t mutexThread
void *(* workRoutine)(void *)
static void * worker(void *)
Working thread.
pthread_mutex_t mutexWorker
pthread_mutex_t mutexWorkItem
ThreadPool(int nThreads, void *(*workRoutine)(void *))
Creates a new thread pool.
virtual ~ThreadPool()
Deletes thread pool.
std::deque< void * > worklist
Implements the thread pool pattern.
int isStopping()
Is thread pool stopping.
long getWorklistSize()
Gets size of worklist.
void exitThread(void *retval)
Exits a worker thread.
void * getWorkItem()
Gets a work item.
int createThread()
Creates a new worker thread.
void add(void *workItem)
Adds a work item to the work list.