1 #ifndef LIBFILEZILLA_THREAD_POOL_HEADER
2 #define LIBFILEZILLA_THREAD_POOL_HEADER
19 class async_task_impl;
40 explicit operator bool()
const {
return impl_ !=
nullptr; }
48 async_task_impl* impl_{};
52 class pooled_thread_impl;
72 async_task spawn(std::function<
void()>
const& f);
76 friend class pooled_thread_impl;
78 std::vector<pooled_thread_impl*> threads_;
79 std::vector<pooled_thread_impl*> idle_;
Thread synchronization primitives: mutex, scoped_lock and condition.
Handle for asynchronous tasks.
Definition: thread_pool.hpp:23
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:27
A dumb thread-pool for asynchronous tasks.
Definition: thread_pool.hpp:62