diff options
author | Derek Mauro <dmauro@google.com> | 2023-04-12 13:26:48 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-12 13:27:28 -0700 |
commit | c23acb9b5636e7b908fba03d6b3584d8f80dba6d (patch) | |
tree | cc2332512cecd0d3efb2f3819516fb6d7af44bc6 /absl/synchronization/internal/futex.h | |
parent | 32d314d0f5bb0ca3ff71ece49c71a728c128d43e (diff) |
Synchronization: Consolidate the logic for whether steady clocks are supported
for relative timeouts
PiperOrigin-RevId: 523789416
Change-Id: Ide4cfdcae9ea7bffca3355c80ea9c8833a9536e6
Diffstat (limited to 'absl/synchronization/internal/futex.h')
-rw-r--r-- | absl/synchronization/internal/futex.h | 25 |
1 files changed, 0 insertions, 25 deletions
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<int32_t>* 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<int32_t>* v, int32_t val) { |