diff options
author | Abseil Team <absl-team@google.com> | 2020-10-13 08:26:15 -0700 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2020-10-13 12:49:13 -0400 |
commit | f3f785ab59478dd0312bf1b5df65d380650bf0dc (patch) | |
tree | c6cb0ba6e13b43ccfc1c60bf4dfed9ea0d38e62f /absl/synchronization/internal/futex.h | |
parent | 4b2fbb4adba905eede6c61b4494acfdb660a3bb7 (diff) | |
download | abseil-f3f785ab59478dd0312bf1b5df65d380650bf0dc.tar.gz abseil-f3f785ab59478dd0312bf1b5df65d380650bf0dc.tar.bz2 abseil-f3f785ab59478dd0312bf1b5df65d380650bf0dc.zip |
Export of internal Abseil changes
--
5bd06440e700fefd6eadd577d7d69c51f15c63e0 by Abseil Team <absl-team@google.com>:
Add if-guard to futex.h so that it doesn't fail to parse for unsupported platforms
PiperOrigin-RevId: 336880375
--
8b3d3bb4ad123fc9f648f0e397b2eddd88dc0c02 by Derek Mauro <dmauro@google.com>:
Fix race in AddressIsReadable file descriptors using stronger memory ordering
PiperOrigin-RevId: 336874423
--
1d8bf23747009cca29129b80c2793bc91443dd55 by Derek Mauro <dmauro@google.com>:
Avoid -Wundef warnings on ABSL_HAVE_THREAD_LOCAL
PiperOrigin-RevId: 336792406
--
562a480f029c600c1d3b1428da6a9b09e8952a74 by Derek Mauro <dmauro@google.com>:
Fix preprocessor condition for symbols __tsan_mutex_read_lock and
__tsan_mutex_try_lock
PiperOrigin-RevId: 336732571
GitOrigin-RevId: 5bd06440e700fefd6eadd577d7d69c51f15c63e0
Change-Id: Id9bb331baec74b9d80c7b228959a7739bc30e694
Diffstat (limited to 'absl/synchronization/internal/futex.h')
-rw-r--r-- | absl/synchronization/internal/futex.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/absl/synchronization/internal/futex.h b/absl/synchronization/internal/futex.h index 3539f491..06fbd6d0 100644 --- a/absl/synchronization/internal/futex.h +++ b/absl/synchronization/internal/futex.h @@ -38,6 +38,19 @@ #include "absl/base/optimization.h" #include "absl/synchronization/internal/kernel_timeout.h" +#ifdef ABSL_INTERNAL_HAVE_FUTEX +#error ABSL_INTERNAL_HAVE_FUTEX may not be set on the command line +#elif defined(__BIONIC__) +// Bionic supports all the futex operations we need even when some of the futex +// definitions are missing. +#define ABSL_INTERNAL_HAVE_FUTEX +#elif defined(__linux__) && defined(FUTEX_CLOCK_REALTIME) +// FUTEX_CLOCK_REALTIME requires Linux >= 2.6.28. +#define ABSL_INTERNAL_HAVE_FUTEX +#endif + +#ifdef ABSL_INTERNAL_HAVE_FUTEX + namespace absl { ABSL_NAMESPACE_BEGIN namespace synchronization_internal { @@ -136,4 +149,6 @@ class Futex : public FutexImpl {}; ABSL_NAMESPACE_END } // namespace absl +#endif // ABSL_INTERNAL_HAVE_FUTEX + #endif // ABSL_SYNCHRONIZATION_INTERNAL_FUTEX_H_ |