|
XNetwork 1.7.5; VERSION ${PROJECT_VERSION}
|
#include <condition_variable>#include <functional>#include <future>#include <memory>#include <mutex>#include <queue>#include <thread>#include <type_traits>#include <utility>

Go to the source code of this file.
Classes | |
| class | xnetwork::thread_pool |
Namespaces | |
| namespace | xnetwork |
Minimal header-only thread pool for C++17.
Owns a fixed set of worker threads that process tasks from a shared queue. Tasks are enqueued via enqueue() which returns a std::future to the result.
Usage:
The destructor waits for all pending tasks to finish and joins all worker threads. It is safe to destroy the pool while tasks are still running - remaining tasks are abandoned.