2#include "BS_thread_pool.hpp"
15 std::shared_ptr<BS::thread_pool> _pool;
29 typename F,
typename... A,
30 typename R = std::invoke_result_t<std::decay_t<F>, std::decay_t<A>...>>
31 [[nodiscard]] std::future<R>
submit(F &&task, A &&...args) {
33 return _pool->submit(task, args...);
38 template <
typename F,
typename... A>
void push_task(F &&task, A &&...args) {
39 _pool->push_task(task, args...);
Simple wrapper around BS::thread_pool that makes a BS::thread_pool a singleton, such that a thread po...
GlobalThreadPool()
Instantiate handle to the thread pool.
void push_task(F &&task, A &&...args)
Wrapper around BS::thread_pool::push_task(...)
GlobalThreadPool & operator=(const GlobalThreadPool &)=default
GlobalThreadPool(const GlobalThreadPool &)=default
std::future< R > submit(F &&task, A &&...args)
Wrapper around BS::thread_pool::submit(...)