spark-qt-research/ThreadPool/main.cpp

25 lines
530 B
C++
Raw Normal View History

2020-11-20 10:06:01 +08:00
#include "ThreadPool.hpp"
#include <iostream>
void func(int a, int b)
{
std::cout << a << "+" << b << "=" << a + b << std::endl;
return;
}
/**
* 线退
* 线
*/
int main(int argc, char const *argv[])
{
std::cout << "测试输出!" << std::endl;
ThreadPool<> pool(5);
Task t1(func, 3, 4), t2(func, 5, 6);
pool.addOneTask(&t1);
pool.addOneTask(&t2);
return 0;
}