线程池,创建一组线程等待着从任务队列中获取任务执行
更多...
#include <threads.hpp>
线程池,创建一组线程等待着从任务队列中获取任务执行
在文件 threads.hpp 第 619 行定义.
枚举值 |
---|
modeWaitKeep |
一直等待上一个任务
|
modeWaitTimeRePost |
等待一定时间后重投
|
在文件 threads.hpp 第 623 行定义.
构造函数1
- 参数
-
threadCount | 启动的线程数量 |
mode | 线程池模式 |
durationSec | 等待的时间 |
在文件 threads.hpp 第 633 行定义.
virtual winux::ThreadPool::~ThreadPool |
( |
| ) |
|
|
inlinevirtual |
double winux::ThreadPool::getDurationSec |
( |
| ) |
const |
|
inline |
size_t winux::ThreadPool::getTaskCount |
( |
| ) |
const |
|
inline |
void winux::ThreadPool::stop |
( |
| ) |
|
|
inline |
template<typename _Fx , typename... _ArgType>
Task<typename FuncTraits<_Fx>::ReturnType> winux::ThreadPool::task |
( |
_Fx |
fn, |
|
|
_ArgType &&... |
arg |
|
) |
| |
|
inline |
bool winux::ThreadPool::wait |
( |
double |
sec = -1 | ) |
|
|
inline |
wait(sec>0)等待一定的时间长用于等待任务运行。当调用stop()后,wait(sec<0)等待线程组线程全部正常退出
在文件 threads.hpp 第 685 行定义.
void winux::ThreadPool::whenEmptyStopAndWait |
( |
| ) |
|
|
inline |
该类的文档由以下文件生成: