ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
polling_wait.hpp
Go to the documentation of this file.
1#pragma once
2
7#include <chrono>
8#include <condition_variable>
9
11{
12
13template <unsigned IntervalMs = 10>
15{
16 template <typename Lock, typename Pred>
17 static auto
18 wait(std::condition_variable& cv, Lock& lock, Pred pred) -> bool
19 {
20 return cv.wait_for(lock, std::chrono::milliseconds(IntervalMs), pred);
21 }
22};
23
24} // namespace threadschedule::detail
Aggregates multiple thread_registry_backend instances into a single queryable view.
static auto wait(std::condition_variable &cv, Lock &lock, Pred pred) -> bool