Botan 3.8.1
Crypto and TLS for C&
|
#include <thread_pool.h>
Public Member Functions | |
Thread_Pool & | operator= (const Thread_Pool &)=delete |
Thread_Pool & | operator= (Thread_Pool &&)=delete |
void | queue_thunk (const std::function< void()> &) |
template<class F, class... Args> | |
auto | run (F &&f, Args &&... args) -> std::future< typename std::invoke_result< F, Args... >::type > |
void | shutdown () |
Thread_Pool (const Thread_Pool &)=delete | |
Thread_Pool (size_t pool_size=0) | |
Thread_Pool (std::optional< size_t > pool_size) | |
Thread_Pool (Thread_Pool &&)=delete | |
size_t | worker_count () const |
~Thread_Pool () | |
Static Public Member Functions | |
static Thread_Pool & | global_instance () |
Definition at line 25 of file thread_pool.h.
Botan::Thread_Pool::Thread_Pool | ( | std::optional< size_t > | pool_size | ) |
Initialize a thread pool with some number of threads
pool_size | number of threads in the pool, if 0 then some default value is chosen. If the optional is nullopt then the thread pool is disabled; all work is executed immediately when queued. |
Definition at line 60 of file thread_pool.cpp.
References Botan::OS::get_cpu_available().
Referenced by global_instance(), operator=(), operator=(), Thread_Pool(), Thread_Pool(), and Thread_Pool().
|
inline |
Initialize a thread pool with some number of threads
pool_size | number of threads in the pool, if 0 then some default value is chosen. |
Definition at line 46 of file thread_pool.h.
References Thread_Pool().
|
inline |
|
delete |
References Thread_Pool().
|
delete |
References Thread_Pool().
|
static |
Return an instance to a shared thread pool
Definition at line 55 of file thread_pool.cpp.
References Thread_Pool().
|
delete |
References Thread_Pool().
|
delete |
References queue_thunk(), and Thread_Pool().
void Botan::Thread_Pool::queue_thunk | ( | const std::function< void()> & | fn | ) |
Definition at line 115 of file thread_pool.cpp.
References Botan::lock().
Referenced by operator=(), and run().
|
inline |
Definition at line 66 of file thread_pool.h.
References queue_thunk().
void Botan::Thread_Pool::shutdown | ( | ) |
Definition at line 96 of file thread_pool.cpp.
References Botan::lock().
Referenced by ~Thread_Pool().
|
inline |
Definition at line 52 of file thread_pool.h.