线程关联类
代码说明:
#include "ThreadPool.h"#include "WorkerThread.h"#include "Task.h"/******************************************************************************** 线程池******************************************************************************/CThreadPool::CThreadPool(int initnum){m_threadNum = initnum;m_maxThrNum = initnum * 2; // 最多线程数for(int i = 0; i < m_threadNum; i++){ CWorkerThread* thr = new CWorkerThread(); thr->SetThreadPool(this); thr->Start();AppendToIdleList(thr); }m_monitor = 0;}CThreadPool::~CThreadPool(){ TerminateAll();}void CThreadPool::TerminateAll(){m_mtxTaskList.Lock();m_taskList.clear();m_mtxTas
下载说明:请别用迅雷下载,失败请重下,重下不扣分!