| 2027 | */ |
| 2028 | template <typename C, typename D> |
| 2029 | bool wait_until(const std::chrono::time_point<C, D>& timeout_time) |
| 2030 | { |
| 2031 | #ifdef __cpp_exceptions |
| 2032 | if constexpr (wait_deadlock_checks_enabled) |
| 2033 | { |
| 2034 | if (this_thread::get_pool() == this) |
| 2035 | throw wait_deadlock(); |
| 2036 | } |
| 2037 | #endif |
| 2038 | std::unique_lock tasks_lock(tasks_mutex); |
| 2039 | waiting = true; |
| 2040 | const bool status = tasks_done_cv.wait_until(tasks_lock, timeout_time, |
| 2041 | [this] |
| 2042 | { |
| 2043 | if constexpr (pause_enabled) |
| 2044 | return (tasks_running == 0) && (paused || tasks.empty()); |
| 2045 | else |
| 2046 | return (tasks_running == 0) && tasks.empty(); |
| 2047 | }); |
| 2048 | waiting = false; |
| 2049 | return status; |
| 2050 | } |
| 2051 | |
| 2052 | private: |
| 2053 | // ======================== |
nothing calls this directly
no test coverage detected