MyThreadPool/main.cpp
2022-05-29 22:33:19 +02:00

22 lines
375 B
C++

#include <iostream>
#include <MyThreadPool.h>
int main() {
MyThreadPool::ThreadPool tp(4);
auto task = [](int i) {
std::cout << "Test " << i << "\n";
return i / 2;
};
auto fut = tp.enqueue(0, task, 10);
tp.waitForTasks();
// std::cout << "All: " << fut.get() << std::endl;
std::cout << "Done." << std::endl;
return 0;
}