LASP 1.0
Library for Acoustic Signal Processing
|
Simple wrapper around BS::thread_pool that makes a BS::thread_pool a singleton, such that a thread pool can be used around in the code, and safely spawn threads also from other threads. Only wraps a submit() and push_task for now. More...
#include <lasp_thread.h>
Public Member Functions | |
GlobalThreadPool () | |
Instantiate handle to the thread pool. | |
GlobalThreadPool (const GlobalThreadPool &)=default | |
GlobalThreadPool & | operator= (const GlobalThreadPool &)=default |
template<typename F , typename... A, typename R = std::invoke_result_t<std::decay_t<F>, std::decay_t<A>...>> | |
std::future< R > | submit (F &&task, A &&...args) |
Wrapper around BS::thread_pool::submit(...) | |
template<typename F , typename... A> | |
void | push_task (F &&task, A &&...args) |
Wrapper around BS::thread_pool::push_task(...) | |
Simple wrapper around BS::thread_pool that makes a BS::thread_pool a singleton, such that a thread pool can be used around in the code, and safely spawn threads also from other threads. Only wraps a submit() and push_task for now.
Definition at line 10 of file lasp_thread.h.
GlobalThreadPool::GlobalThreadPool | ( | ) |
Instantiate handle to the thread pool.
See if we can get it from the global ptr. If not, time to allocate it.
Definition at line 23 of file lasp_thread.cpp.
|
default |
|
default |
|
inline |
Wrapper around BS::thread_pool::push_task(...)
Definition at line 38 of file lasp_thread.h.
|
inline |
Wrapper around BS::thread_pool::submit(...)
Definition at line 31 of file lasp_thread.h.