10 #include <semaphore.h>
26 typedef void *(*ThreadFunc)(
void *);
33 unsigned virtual executeThis()
39 WorkerThread(ThreadFunc job,
void *arg): job_func(job), job_arg(arg)
59 static pthread_mutex_t mutexSync;
60 static pthread_mutex_t mutexWorkCompletion;
80 void finishAll(
int maxPollMilliSecs)
85 void destroyPool(
int maxPollMilliSecs)
90 bool assignWork(WorkerThread *workerThread)
95 bool fetchWork(WorkerThread **workerArg)
100 void *threadExecute(
void *param)
106 void initializeThreads()
113 pthread_cond_t condCrit;
115 sem_t availableThreads;
117 std::vector<WorkerThread *> workerQueue;
129 pthread_mutex_t ThreadPool::mutexSync = PTHREAD_MUTEX_INITIALIZER;
130 pthread_mutex_t ThreadPool::mutexWorkCompletion = PTHREAD_MUTEX_INITIALIZER;
ThreadPool class manages all the ThreadPool related activities. This includes keeping track of idle t...
Definition: thread_pool.h:55
Contains classes that help with thread management. Currently only Pthreads. This was used earlier whe...