C++ Logo

std-proposals

Advanced search

[std-proposals] Timed lock algorithms for multiple lockables - Was: std::try_lock_for and std::try_lock_until

From: Ted Lyngmo <ted_at_[hidden]>
Date: Wed, 27 Aug 2025 22:42:46 +0200
I've made a first draft for the proposal to add

> template <class Clock, class Duration, class... Ls>
> [[nodiscard]] bool
> try_lock_until(const chrono::time_point<Clock, Duration>& abs_time,
> Ls&... ls);
>
> template <class Rep, class Period, class... Ls>
> [[nodiscard]] bool
> try_lock_for(const chrono::duration<Rep, Period>& rel_time,
> Ls&... ls);
which I've attached. This is the first time I've even come this far with
an idea and I would be very greatful for feedback.

Best regards,
Ted Lyngmo

Received on 2025-08-27 20:42:51