资 源 简 介
#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