From c23acb9b5636e7b908fba03d6b3584d8f80dba6d Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 12 Apr 2023 13:26:48 -0700 Subject: Synchronization: Consolidate the logic for whether steady clocks are supported for relative timeouts PiperOrigin-RevId: 523789416 Change-Id: Ide4cfdcae9ea7bffca3355c80ea9c8833a9536e6 --- absl/synchronization/internal/futex_waiter.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'absl/synchronization/internal/futex_waiter.h') diff --git a/absl/synchronization/internal/futex_waiter.h b/absl/synchronization/internal/futex_waiter.h index a6a72095..11dfa93b 100644 --- a/absl/synchronization/internal/futex_waiter.h +++ b/absl/synchronization/internal/futex_waiter.h @@ -43,6 +43,11 @@ class FutexWaiter : public WaiterCrtp { static constexpr char kName[] = "FutexWaiter"; private: + // Atomically check that `*v == val`, and if it is, then sleep until the + // timeout `t` has been reached, or until woken by `Wake()`. + static int WaitUntil(std::atomic* v, int32_t val, + KernelTimeout t); + // Futexes are defined by specification to be 32-bits. // Thus std::atomic must be just an int32_t with lockfree methods. std::atomic futex_; -- cgit v1.2.3