8 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
15 bool b_do_not_block_when_full)
37 for (i = 0; i != num_worker_threads; i++)
39 snprintf(thread_str, 16,
"Pool Thread %3d", i);
66 CAMsg::printMsg(LOG_INFO,
"CAThreadPool::addRequest() -the Thread pool is full...waiting!\n");
THREAD_RETURN(* THREAD_MAIN_TYP)(void *)
Defines the type of the main function of the thread.
THREAD_RETURN worker_thread_main_loop(void *arg)
void * tpool_thread(void *)
struct tpool_work tpool_work_t
#define THREAD_RETURN_SUCCESS
SINT32 signal()
Signals this object.
SINT32 broadcast()
Signals this object.
SINT32 wait()
Waits for a signal or for a timeout.
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
SINT32 start(void *param, bool bDaemon=false, bool bSilent=false)
Starts the execution of the main function of this thread.
SINT32 setMainLoop(THREAD_MAIN_TYP fnc)
Sets the main function which will be executed within this thread.
SINT32 join()
Waits for the main function to finish execution.
volatile bool m_bShutdown
CAConditionVariable * m_pcondNotFull
friend THREAD_RETURN worker_thread_main_loop(void *args)
SINT32 destroy(bool bWaitForFinish)
tpool_work_t * m_pQueueTail
SINT32 addRequest(THREAD_MAIN_TYP, void *args)
Adds a new request (task) to this threadpool.
volatile bool m_bQueueClosed
CAConditionVariable * m_pcondNotEmpty
volatile UINT32 m_CurQueueSize
CAThreadPool(UINT32 num_worker_threads, UINT32 max_queue_size, bool b_do_not_block_when_full)
bool m_bDoNotBlockWhenFull
tpool_work_t * m_pQueueHead
CAConditionVariable * m_pcondEmpty