首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 线程关联类

线程关联类

  • 资源大小:1.80 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: c++,c

资 源 简 介

#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

文 件 列 表

ThreadPool.cpp
ThreadPool.h
VIP VIP
0.203688s