|
◆ run()
template<typename CondVar >
template<typename Fn , typename ... Args>
requires std::invocable<Fn, Args...> auto coro::thread_pool_t< CondVar >::run |
( |
Fn && |
fn, |
|
|
Args &&... |
args |
|
) |
| -> future<std::invoke_result_t<Fn, Args...> > |
|
inline |
Run a function in the thread_pool.
- Parameters
-
fn | function / lambda function or pointer to function |
args | arguments (optional) |
- Returns
- future, which is resolved with a return value of the function. If the function doesn't return, result is future<void>. You need to co_await on result (can't be discarded).
Definition at line 81 of file thread_pool.h.
|