ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
lightweight_pool.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../detail/pool/backend.hpp"
4#include "../detail/pool/facade.hpp"
5
7{
8class lightweight_pool final
9 : private ::threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend>
10{
12
13public:
16 : base(count, registration)
17 {
18 }
19
23 using base::post;
25 using base::shutdown;
27 using base::size;
28};
29} // namespace threadschedule::advanced
lightweight_pool(worker_count count=worker_count::automatic(), worker_registration registration=worker_registration::disabled)
auto shutdown(shutdown_policy policy=shutdown_policy::drain) -> result< void >
Value type for pool worker count.
static constexpr auto automatic() noexcept -> worker_count
Create automatic worker count.
worker_registration
Controls whether pool workers are registered in a thread registry.
@ disabled
Do not register workers in the global registry.