327 std::unique_lock<std::mutex>
guard{that->lock_};
330 while (!that->done_ || that->items_ > 0) {
332 that->wake_.wait_until(
guard, that->earliest_, [&]() {
333 return that->dirty_ != 0 ||
334 std::chrono::system_clock::now() >= that->earliest_;
342 auto earliest =
start + std::chrono::hours(24);
343 auto process = time_item_process_pred_fn<E, TP>{&
start, &earliest};
345 auto process_begin = std::partition(
346 that->pending_.begin(), that->pending_.end(), process);
347 that->earliest_ = earliest;
354 that->pending_.end(),
355 std::back_inserter(that->ready_),
356 time_queue_dispatch_pred_fn<E, TP>{});
359 that->pending_.erase(process_begin, that->pending_.end());
368 for (
auto& q : that->ready_) {
372 that->ready_.clear();
374 that->joined_ =
true;
382 std::unique_lock<std::mutex>
guard{that->lock_};
385 that->error_ = std::current_exception();
386 for (
auto& q : that->pending_) {
387 while (!q->heap_.empty()) {
constexpr detail::Map< Move > move
std::chrono::steady_clock::time_point now()
PUSHMI_INLINE_VAR constexpr __adl::set_error_fn set_error
GuardImpl guard(ErrorHandler &&handler)
static void start(std::shared_ptr< time_source_shared< E, TP >> that)