Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !
explicit ThreadPool::ThreadPool( std::size_t numberThreads = std::ranges::max(1uz, static_cast<std::size_t>(std::thread::hardware_concurrency())), std::function<void(std::exception_ptr)> onError = nullptr, std::function<void()> finally = nullptr);

ThreadPool::ThreadPool(const ThreadPool&) = delete;

ThreadPool& ThreadPool::operator=(const ThreadPool&) = delete;

ThreadPool::ThreadPool(ThreadPool&&) = delete;

ThreadPool& ThreadPool::operator=(ThreadPool&&) = delete;

ThreadPool::~ThreadPool();

auto ThreadPool::call(auto&& function) -> std::future<std::invoke_result_t<std::decay_t<decltype(function)>>>;

auto ThreadPool::waitUntilFinished() -> void;

auto ThreadPool::setOnError(std::function<void(std::exception_ptr)> onError) noexcept -> void;

[[nodiscard]] auto ThreadPool::numberThreads() const noexcept -> std::size_t;