summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2023-04-20 12:15:27 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-04-20 12:16:23 -0700
commitf8bf909108b3604a00590a074f2986c0895514d2 (patch)
treed2d0e5387fd0253c8a7c652a07a5e8b0640d2c22 /absl
parent9686b7be4416746a7187a1979f34d32b925a485b (diff)
Support pthread_cond_clockwait() and sem_clockwait() on Android
for __ANDROID_API__ >= 30 https://android.googlesource.com/platform/bionic/+/69010802d037dbc10377416bd9cc696fa34b9384%5E%21/libc/include/pthread.h PiperOrigin-RevId: 525815479 Change-Id: I88cd1a06a4f7bb5380ff7c1e6a8f45e2b04b7df8
Diffstat (limited to 'absl')
-rw-r--r--absl/synchronization/internal/pthread_waiter.cc2
-rw-r--r--absl/synchronization/internal/sem_waiter.cc2
2 files changed, 4 insertions, 0 deletions
diff --git a/absl/synchronization/internal/pthread_waiter.cc b/absl/synchronization/internal/pthread_waiter.cc
index 366aaea2..bf700e95 100644
--- a/absl/synchronization/internal/pthread_waiter.cc
+++ b/absl/synchronization/internal/pthread_waiter.cc
@@ -81,6 +81,8 @@ PthreadWaiter::PthreadWaiter() : waiter_count_(0), wakeup_count_(0) {
#if defined(__GLIBC__) && \
(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 30))
#define ABSL_INTERNAL_HAVE_PTHREAD_COND_CLOCKWAIT 1
+#elif defined(__ANDROID_API__) && __ANDROID_API__ >= 30
+#define ABSL_INTERNAL_HAVE_PTHREAD_COND_CLOCKWAIT 1
#endif
// Calls pthread_cond_timedwait() or possibly something else like
diff --git a/absl/synchronization/internal/sem_waiter.cc b/absl/synchronization/internal/sem_waiter.cc
index 3b3849bf..d62dbdc7 100644
--- a/absl/synchronization/internal/sem_waiter.cc
+++ b/absl/synchronization/internal/sem_waiter.cc
@@ -46,6 +46,8 @@ SemWaiter::SemWaiter() : wakeups_(0) {
#if defined(__GLIBC__) && \
(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 30))
#define ABSL_INTERNAL_HAVE_SEM_CLOCKWAIT 1
+#elif defined(__ANDROID_API__) && __ANDROID_API__ >= 30
+#define ABSL_INTERNAL_HAVE_SEM_CLOCKWAIT 1
#endif
// Calls sem_timedwait() or possibly something else like