现代C++写的线程池
Go to file
Kirigaya Kazuto 00a07d006b Add Readme 2017-11-09 14:50:30 +08:00
Readme.md Add Readme 2017-11-09 14:50:30 +08:00
ThreadPool.cpp Update ThreadPool 2017-11-09 14:50:13 +08:00
ThreadPool.h Update ThreadPool 2017-11-09 14:50:13 +08:00

Readme.md

ThreadPool

使用现代C++写的线程池.

class ThreadPool 线程池类

不可复制,不可移动

构造时需指定最大线程数,构造后不可更改

析构时等待所有线程工作结束.

API参考:

int start(const std::function<void()>&) 发送一个任务到线程池

返回值:

-1 无法启动任务,线程池已满

-2 线程池内部错误

>=0 任务启动成功,返回工作线程序号.