1
#ifndef CBTHREADPOOL_EXTRAS_H
2
#define CBTHREADPOOL_EXTRAS_H
4
/// Josuttis' implementation of CountedPtr
13
explicit CountedPtr(T *p = 0);
14
CountedPtr(const CountedPtr<T> &p) throw();
15
~CountedPtr() throw();
16
CountedPtr<T> &operator = (const CountedPtr<T> &p) throw();
17
T &operator * () const throw();
18
T *operator -> () const throw();
24
/** A Worker Thread class.
26
* These are the ones that execute the tasks.
27
* You shouldn't worry about it since it's for "private" purposes of the Pool.
29
class cbWorkerThread : public wxThread
32
/** cbWorkerThread ctor
34
* @param pool Thread Pool this Worker Thread belongs to
35
* @param semaphore Used to synchronise the Worker Threads
37
cbWorkerThread(cbThreadPool *pool, CountedPtr<wxSemaphore> &semaphore);
39
/// Entry point of this thread. The magic happens here.
42
/// Tell the thread to abort. It will also tell the task to abort (if any)
45
/** Tells whether we should abort or not
47
* @return true if we should abort
51
/// Aborts the running task (if any)
56
cbThreadPool *m_pPool;
57
CountedPtr<wxSemaphore> m_semaphore;
58
cbThreadedTask *m_pTask;