summaryrefslogtreecommitdiff
path: root/absl/synchronization/internal/futex_waiter.h
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2023-04-12 13:26:48 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-04-12 13:27:28 -0700
commitc23acb9b5636e7b908fba03d6b3584d8f80dba6d (patch)
treecc2332512cecd0d3efb2f3819516fb6d7af44bc6 /absl/synchronization/internal/futex_waiter.h
parent32d314d0f5bb0ca3ff71ece49c71a728c128d43e (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_waiter.h')
-rw-r--r--absl/synchronization/internal/futex_waiter.h5
1 files changed, 5 insertions, 0 deletions
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<FutexWaiter> {
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<int32_t>* v, int32_t val,
+ KernelTimeout t);
+
// Futexes are defined by specification to be 32-bits.
// Thus std::atomic<int32_t> must be just an int32_t with lockfree methods.
std::atomic<int32_t> futex_;