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.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'absl/synchronization/internal/futex.h') diff --git a/absl/synchronization/internal/futex.h b/absl/synchronization/internal/futex.h index 8d973263..55078f14 100644 --- a/absl/synchronization/internal/futex.h +++ b/absl/synchronization/internal/futex.h @@ -83,31 +83,6 @@ namespace synchronization_internal { class FutexImpl { public: - // 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) { - // Monotonic waits are disabled for production builds because go/btm - // requires synchronized clocks. - // TODO(b/160682823): Find a way to enable this when BTM is not enabled - // since production builds don't always run on Borg. -#if defined(CLOCK_MONOTONIC) && !defined(__GOOGLE_GRTE_VERSION__) - constexpr bool kRelativeTimeoutSupported = true; -#else - constexpr bool kRelativeTimeoutSupported = false; -#endif - - if (!t.has_timeout()) { - return Wait(v, val); - } else if (kRelativeTimeoutSupported && t.is_relative_timeout()) { - auto rel_timespec = t.MakeRelativeTimespec(); - return WaitRelativeTimeout(v, val, &rel_timespec); - } else { - auto abs_timespec = t.MakeAbsTimespec(); - return WaitAbsoluteTimeout(v, val, &abs_timespec); - } - } - // Atomically check that `*v == val`, and if it is, then sleep until the until // woken by `Wake()`. static int Wait(std::atomic* v, int32_t val) { -- cgit v1.2.3