CPPMyth
Library to interoperate with MythTV server
NSROOT::OS::CThreadPool Class Reference
Collaboration diagram for NSROOT::OS::CThreadPool:

Public Member Functions

 CThreadPool (unsigned size)
 
bool Enqueue (CWorker *worker)
 
unsigned GetMaxSize () const
 
void SetMaxSize (unsigned size)
 
void SetKeepAlive (unsigned millisec)
 
unsigned Size () const
 
unsigned QueueSize () const
 
bool IsQueueEmpty () const
 
bool waitEmpty (unsigned millisec)
 
bool waitEmpty ()
 
void Suspend ()
 
void Resume ()
 
bool IsSuspended () const
 
void Reset ()
 
void Stop ()
 
void Start ()
 
bool IsStopped () const
 

Private Member Functions

CWorkerPopQueue (CWorkerThread *_thread)
 
void WaitQueue (CWorkerThread *_thread)
 
void StartThread (CWorkerThread *_thread)
 
void FinalizeThread (CWorkerThread *_thread)
 
void __resize ()
 

Private Attributes

unsigned m_size
 
unsigned m_keepAlive
 
unsigned m_poolSize
 
unsigned m_waitingCount
 
volatile bool m_stopped
 
volatile bool m_suspended
 
volatile bool m_empty
 
std::queue< CWorker * > m_queue
 
std::set< CWorkerThread * > m_pool
 
CMutex m_mutex
 
CCondition< volatile bool > m_condition
 
CEvent m_queueFill
 
CEvent m_queueEmpty
 

Friends

class CWorkerThread
 

Detailed Description

Definition at line 39 of file threadpool.h.


The documentation for this class was generated from the following files: