49 unsigned GetMaxSize()
const {
return m_size; }
51 void SetMaxSize(
unsigned size);
53 void SetKeepAlive(
unsigned millisec);
55 unsigned Size()
const;
57 unsigned QueueSize()
const;
58 bool IsQueueEmpty()
const;
59 bool waitEmpty(
unsigned millisec);
64 bool IsSuspended()
const;
69 bool IsStopped()
const;
75 unsigned m_waitingCount;
76 volatile bool m_stopped;
77 volatile bool m_suspended;
78 volatile bool m_empty;
80 std::queue<CWorker*> m_queue;
81 std::set<CWorkerThread*> m_pool;
100 virtual void Process() = 0;
111 , m_threadPool(pool) { m_finalizeOnStop =
true; }
115 bool waiting =
false;
119 CWorker* worker = m_threadPool.PopQueue(
this);
128 m_threadPool.WaitQueue(
this);
140 m_threadPool.FinalizeThread(
this);