コード例 #1
0
ファイル: workerthread.cpp プロジェクト: ballacky13/toast
// worker thread is a thread that wait work in the work queue
WorkerThread * WorkerThread::Create(pthread_attr_t *attr)
{
    WorkerThread *worker;
    if((worker = new (std::nothrow)WorkerThread(attr)) == NULL)
    {
        errno = ENOMEM;
        return (NULL);
    }
    worker->CreateWorker();
    return (worker);
}
コード例 #2
0
ファイル: workerthread.cpp プロジェクト: ballacky13/toast
void WorkerThread::WorkerCleanup(void *param)
{
    WorkerThread *worker = (WorkerThread *)param;
    if (worker->m_worker_flags & WORKER_DESTROY) 
    {
        pthread_cond_broadcast(&worker->m_worker_workcv);
    } 
    else
    {
        worker->CreateWorker();
    }
    pthread_mutex_unlock(&worker->m_worker_mutex);
}