22 lines
375 B
C++
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;
|
|
}
|