[libcxx-commits] [libcxx] [libc++][chrono][threading] Implement LWG 3504: `condition_variable::wait_for` is overspecified (PR #222443)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 10 02:55:29 PDT 2026


================
@@ -40,6 +40,12 @@ _LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
 _LIBCPP_DECLARE_STRONG_ENUM(cv_status){no_timeout, timeout};
 _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
 
+template <class _Duration>
+inline _LIBCPP_HIDE_FROM_ABI chrono::steady_clock::time_point __rel_to_abs(const _Duration& __rel_time) {
+  using namespace chrono;
+  return steady_clock::now() + ceil<steady_clock::duration>(__rel_time);
+}
+
----------------
frederick-vs-ja wrote:

Simple `chrono::ceil` (present since C++17) doesn't work. We also need to create an equivalent __ugly version available in old modes.

https://github.com/llvm/llvm-project/pull/222443


More information about the libcxx-commits mailing list