|
Ginger 1.1.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 | ginger::thread_pool |
Namespaces | |
| namespace | ginger |
Functions | |
| auto | ginger::get_thread_pool () -> thread_pool & |
| Convenience accessor returning a singleton thread pool. | |
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.