Exemplo n.º 1
0
//-------------------------------------------------------------------------------------
ThreadPool::ThreadPool():
isInitialize_(false),
bufferedTaskList_(),
finiTaskList_(),
isDestroyed_(false)
{		
	extraNewAddThreadCount_ =  0;
	currentThreadCount_ =  0;
	currentFreeThreadCount_ =  0;
	normalThreadCount_ = 0;
	
	THREAD_MUTEX_INIT(threadStateList_mutex_);	
	THREAD_MUTEX_INIT(bufferedTaskList_mutex_);
	THREAD_MUTEX_INIT(finiTaskList_mutex_);
}
Exemplo n.º 2
0
//-------------------------------------------------------------------------------------
ThreadPool::ThreadPool():
    isInitialize_(false),
    bufferedTaskList_(),
    finiTaskList_(),
    finiTaskList_count_(0),
    bufferedTaskList_mutex_(),
    threadStateList_mutex_(),
    finiTaskList_mutex_(),
    busyThreadList_(),
    freeThreadList_(),
    allThreadList_(),
    maxThreadCount_(0),
    extraNewAddThreadCount_(0),
    currentThreadCount_(0),
    currentFreeThreadCount_(0),
    normalThreadCount_(0),
    isDestroyed_(false)
{
    THREAD_MUTEX_INIT(threadStateList_mutex_);
    THREAD_MUTEX_INIT(bufferedTaskList_mutex_);
    THREAD_MUTEX_INIT(finiTaskList_mutex_);
}
Exemplo n.º 3
0
/* =============================================================================
 * thread_barrier_init
 * =============================================================================
 */
void
thread_barrier_init (thread_barrier_t* barrierPtr)
{
    long i;
    long numThread = barrierPtr->numThread;

    for (i = 0; i < numThread; i++) {
        barrierPtr[i].count = 0;
        THREAD_MUTEX_INIT(barrierPtr[i].countLock);
        THREAD_COND_INIT(barrierPtr[i].proceedCond);
        THREAD_COND_INIT(barrierPtr[i].proceedAllCond);
    }
}
Exemplo n.º 4
0
	virtual void initMutex(void)
	{
		THREAD_MUTEX_INIT(mutex_);	
	}
Exemplo n.º 5
0
TaskDispatcher::TaskDispatcher():_taskQueue()
{
	THREAD_MUTEX_INIT(_lock);
}
Exemplo n.º 6
0
 ThreadMutex(void)
 {
     THREAD_MUTEX_INIT(mutex_);
 }