线程关联类
2017-11-22
1 0 0
暂无评分
其他
如何获取积分?
#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
#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
相关源码推荐
使用Java开发Android AOA Android开放式附件
0
0
暂无评分
Golang AOA Android开放式附件HID控制
0
0
暂无评分
pclite
0
0
暂无评分
GMSK线性接收机
0
0
暂无评分
传世AFT中变打金版版本--以前很火爆的,收藏很久
0
0
暂无评分
暂无评论