![]() |
Maria GDK 5.1.0.49
Documentation of native code in develop branch
|
#include <StkThreadPool.h>
Public Member Functions | |
| ThreadPool (size_t threads=std::thread::hardware_concurrency()) | |
| void | stop () |
| template<class F , class... Args> | |
| auto | enqueue (F &&f, Args &&... args) |
ThreadPool - Minimal thread pool with queue
|
inline |
Enqueue a task as a lambda or function. Returns a future with the results:
auto fut = pool.enqueue([] {
return 42;
});
EXPECT_EQ(fut.get(), 42);
|
inline |
Stop the queue processing. Normally done in the destructor, but may be called explicitly for improved control.