12345678910111213141516171819 |
- #include <iostream>
- #include <future>
- #include "ThreadPool.h"
-
- using namespace std;
-
- int sum1(int a, int b) {
- return a + b;
- }
-
- int main() {
- ThreadPool pool;
- pool.start();
- future<int> res = pool.submitTask(sum1, 10, 20);
-
- cout << res.get() << endl;
-
- return 0;
- }
|