This class bla bla.
More...
◆ CAThreadPool()
CAThreadPool::CAThreadPool |
( |
UINT32 |
num_worker_threads, |
|
|
UINT32 |
max_queue_size, |
|
|
bool |
b_do_not_block_when_full |
|
) |
| |
References m_bDoNotBlockWhenFull, m_bQueueClosed, m_bShutdown, m_CurQueueSize, m_MaxQueueSize, m_NumThreads, m_parThreads, m_pcondEmpty, m_pcondNotEmpty, m_pcondNotFull, m_pmutexQueue, m_pQueueHead, m_pQueueTail, CAThread::setMainLoop(), CAThread::start(), and worker_thread_main_loop.
◆ ~CAThreadPool()
CAThreadPool::~CAThreadPool |
( |
| ) |
|
◆ addRequest()
Adds a new request (task) to this threadpool.
- Return values
-
E_SPACe | if there was no more space in the waiting queue and we do not want to wait for an other request to finish |
E_SUCCESS | if this request was added to the working queue |
References tpool_work::arg, CAConditionVariable::broadcast(), E_SPACE, E_SUCCESS, E_UNKNOWN, CAMutex::lock(), m_bDoNotBlockWhenFull, m_bQueueClosed, m_bShutdown, m_CurQueueSize, m_MaxQueueSize, m_pcondNotEmpty, m_pcondNotFull, m_pmutexQueue, m_pQueueHead, m_pQueueTail, tpool_work::next, CAMsg::printMsg(), tpool_work::routine, CAMutex::unlock(), and CAConditionVariable::wait().
Referenced by CALastMixA::loop().
◆ countRequests()
UINT32 CAThreadPool::countRequests |
( |
| ) |
|
◆ destroy()
SINT32 CAThreadPool::destroy |
( |
bool |
bWaitForFinish | ) |
|
References CAConditionVariable::broadcast(), E_SUCCESS, CAThread::join(), CAMutex::lock(), m_bQueueClosed, m_bShutdown, m_CurQueueSize, m_NumThreads, m_parThreads, m_pcondEmpty, m_pcondNotEmpty, m_pcondNotFull, m_pmutexQueue, m_pQueueHead, tpool_work::next, CAMutex::unlock(), and CAConditionVariable::wait().
Referenced by CALastMixA::loop(), CAFirstMixB::loop(), and ~CAThreadPool().
◆ worker_thread_main_loop
◆ m_bDoNotBlockWhenFull
bool CAThreadPool::m_bDoNotBlockWhenFull |
|
private |
◆ m_bQueueClosed
volatile bool CAThreadPool::m_bQueueClosed |
|
private |
◆ m_bShutdown
volatile bool CAThreadPool::m_bShutdown |
|
private |
◆ m_CurQueueSize
volatile UINT32 CAThreadPool::m_CurQueueSize |
|
private |
◆ m_MaxQueueSize
UINT32 CAThreadPool::m_MaxQueueSize |
|
private |
◆ m_NumThreads
UINT32 CAThreadPool::m_NumThreads |
|
private |
◆ m_parThreads
◆ m_pcondEmpty
◆ m_pcondNotEmpty
◆ m_pcondNotFull
◆ m_pmutexQueue
CAMutex* CAThreadPool::m_pmutexQueue |
|
private |
◆ m_pQueueHead
◆ m_pQueueTail