|
Mixe for Privacy and Anonymity in the Internet
|
This class bla bla. More...
#include <CAThreadPool.hpp>
Public Member Functions | |
| CAThreadPool (UINT32 num_worker_threads, UINT32 max_queue_size, bool b_do_not_block_when_full) | |
| ~CAThreadPool () | |
| SINT32 | destroy (bool bWaitForFinish) |
| SINT32 | addRequest (THREAD_MAIN_TYP, void *args) |
| Adds a new request (task) to this threadpool. More... | |
| UINT32 | countRequests () |
Private Attributes | |
| UINT32 | m_NumThreads |
| UINT32 | m_MaxQueueSize |
| bool | m_bDoNotBlockWhenFull |
| CAThread ** | m_parThreads |
| volatile UINT32 | m_CurQueueSize |
| tpool_work_t * | m_pQueueHead |
| tpool_work_t * | m_pQueueTail |
| volatile bool | m_bQueueClosed |
| volatile bool | m_bShutdown |
| CAMutex * | m_pmutexQueue |
| CAConditionVariable * | m_pcondNotEmpty |
| CAConditionVariable * | m_pcondNotFull |
| CAConditionVariable * | m_pcondEmpty |
Friends | |
| THREAD_RETURN | worker_thread_main_loop (void *args) |
This class bla bla.
Definition at line 31 of file CAThreadPool.hpp.
| CAThreadPool::CAThreadPool | ( | UINT32 | num_worker_threads, |
| UINT32 | max_queue_size, | ||
| bool | b_do_not_block_when_full | ||
| ) |
Definition at line 13 of file CAThreadPool.cpp.
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.
|
inline |
Definition at line 37 of file CAThreadPool.hpp.
References destroy().
| SINT32 CAThreadPool::addRequest | ( | THREAD_MAIN_TYP | routine, |
| void * | args | ||
| ) |
Adds a new request (task) to this threadpool.
| 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 |
Definition at line 51 of file CAThreadPool.cpp.
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().
|
inline |
Definition at line 46 of file CAThreadPool.hpp.
References m_CurQueueSize.
| SINT32 CAThreadPool::destroy | ( | bool | bWaitForFinish | ) |
Definition at line 99 of file CAThreadPool.cpp.
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().
|
friend |
Definition at line 155 of file CAThreadPool.cpp.
Referenced by CAThreadPool().
|
private |
Definition at line 55 of file CAThreadPool.hpp.
Referenced by addRequest(), and CAThreadPool().
|
private |
Definition at line 61 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), and destroy().
|
private |
Definition at line 62 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), and destroy().
|
private |
Definition at line 58 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), countRequests(), and destroy().
|
private |
Definition at line 54 of file CAThreadPool.hpp.
Referenced by addRequest(), and CAThreadPool().
|
private |
Definition at line 53 of file CAThreadPool.hpp.
Referenced by CAThreadPool(), and destroy().
|
private |
Definition at line 57 of file CAThreadPool.hpp.
Referenced by CAThreadPool(), and destroy().
|
private |
Definition at line 67 of file CAThreadPool.hpp.
Referenced by CAThreadPool(), and destroy().
|
private |
Definition at line 65 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), and destroy().
|
private |
Definition at line 66 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), and destroy().
|
private |
Definition at line 64 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), and destroy().
|
private |
Definition at line 59 of file CAThreadPool.hpp.
Referenced by addRequest(), CAThreadPool(), and destroy().
|
private |
Definition at line 60 of file CAThreadPool.hpp.
Referenced by addRequest(), and CAThreadPool().