6 #ifndef BACKGROUNDTHREAD_H 7 #define BACKGROUNDTHREAD_H 45 class JobQueue :
public std::deque<AbstractJob*>
77 : queue(q), semaphore(s), die(false), ownsQueue(false), ownsSemaphore(false), ownsJobs(owns_jobs)
84 : queue(new
JobQueue), semaphore(s), die(false), ownsQueue(true), ownsSemaphore(false), ownsJobs(owns_jobs)
91 : queue(q), semaphore(new
wxSemaphore), die(false), ownsQueue(false), ownsSemaphore(true), ownsJobs(owns_jobs)
98 : queue(new
JobQueue), semaphore(new
wxSemaphore), die(false), ownsQueue(true), ownsSemaphore(true), ownsJobs(owns_jobs)
171 for (
unsigned int i = 0; i < num_threads; ++i)
177 for_each(threadList.begin(), threadList.end(),
Agony());
178 for_each(threadList.begin(), threadList.end(),
Death());
185 threadList.push_back(t);
void Queue(AbstractJob *j)
BackgroundThread(JobQueue *q, const bool owns_jobs=true)
void Delete(std::vector< T > &s)
BackgroundThreadPool(size_t num_threads=4)
std::list< BackgroundThread * > ThreadList
BackgroundThread(const bool owns_jobs=true)
void operator()(BackgroundThread *t)
void Push(AbstractJob *j)
ExitCode Entry() override
void Queue(AbstractJob *j)
void AddThread(BackgroundThread *t)
void operator()(BackgroundThread *t)
~BackgroundThread() override
BackgroundThread(JobQueue *q, wxSemaphore *s, const bool owns_jobs=true)
BackgroundThread(wxSemaphore *s, const bool owns_jobs=true)
void wxMilliSleep(unsigned long milliseconds)
virtual void operator()()=0