about summary refs log tree commit diff
path: root/absl/synchronization/internal/waiter.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2017-11-10T14·33-0800
committerkatzdm <katzdm@google.com>2017-11-10T18·09-0500
commit9e94e488f5006172245b2f977ab207ee140aca43 (patch)
tree9d2158789ff957f0efe1fe9189a55bbbce7199d1 /absl/synchronization/internal/waiter.h
parent778abb7c279547afe7a4642063712f13a80b8eea (diff)
Changes imported from Abseil "staging" branch:
  - 28631b3dbc582cb88a637cc4c70886e38a4be0cf Refactoring to support production kernel Futex implementa... by Derek Mauro <dmauro@google.com>
  - 411e7bb779c32bbc02b5fa6f516087a02fcb0812 Update comments about leap smearing. by Abseil Team <absl-team@google.com>

GitOrigin-RevId: 28631b3dbc582cb88a637cc4c70886e38a4be0cf
Change-Id: I0506aa2705212cd466460cae60182b0c2c667972
Diffstat (limited to 'absl/synchronization/internal/waiter.h')
-rw-r--r--absl/synchronization/internal/waiter.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/absl/synchronization/internal/waiter.h b/absl/synchronization/internal/waiter.h
index 025ace42e261..23166f4bfa37 100644
--- a/absl/synchronization/internal/waiter.h
+++ b/absl/synchronization/internal/waiter.h
@@ -29,6 +29,7 @@
 #endif
 
 #include <atomic>
+#include <cstdint>
 
 #include "absl/base/internal/thread_identity.h"
 #include "absl/synchronization/internal/kernel_timeout.h"
@@ -99,10 +100,10 @@ class Waiter {
 
  private:
 #if ABSL_WAITER_MODE == ABSL_WAITER_MODE_FUTEX
-  // Futexes are defined by specification to be ints.
-  // Thus std::atomic<int> must be just an int with lockfree methods.
-  std::atomic<int> futex_;
-  static_assert(sizeof(int) == sizeof(futex_), "Wrong size for futex");
+  // 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_;
+  static_assert(sizeof(int32_t) == sizeof(futex_), "Wrong size for futex");
 
 #elif ABSL_WAITER_MODE == ABSL_WAITER_MODE_CONDVAR
   pthread_mutex_t mu_;