1 #ifndef LIBFILEZILLA_THREAD_POOL_HEADER
2 #define LIBFILEZILLA_THREAD_POOL_HEADER
20 class async_task_impl;
41 explicit operator bool()
const {
return impl_ !=
nullptr; }
49 async_task_impl* impl_{};
53 class pooled_thread_impl;
73 async_task spawn(std::function<
void()>
const& f);
77 pooled_thread_impl* get_or_create_thread();
80 friend class pooled_thread_impl;
82 std::vector<pooled_thread_impl*> threads_;
83 std::vector<pooled_thread_impl*> idle_;
Thread synchronization primitives: mutex, scoped_lock and condition.
Handle for asynchronous tasks.
Definition: thread_pool.hpp:24
The namespace used by libfilezilla.
Definition: apply.hpp:17
Sets some global macros and further includes string.hpp.
Lean replacement for std::(recursive_)mutex.
Definition: mutex.hpp:51
A dumb thread-pool for asynchronous tasks.
Definition: thread_pool.hpp:63