Remove <pthread.h> cruft.
The next NDK to take these headers only supports API 21 and later.
Note that this change leaves the _implementation_ of these functions
behind, so that any old apps calling these APIs should continue to work,
you just can't (without declaring the functions yourself) write new ones
that do (and declaring the functions yourself would only work on LP32
anyway, so that's not going to get you very far in 2023).
Test: treehugger
Change-Id: Ie03514e4215b40f6e9feaa6e4bf5df5b16dc8d59
diff --git a/libc/bionic/pthread_cond.cpp b/libc/bionic/pthread_cond.cpp
index 793dcd9..f444676 100644
--- a/libc/bionic/pthread_cond.cpp
+++ b/libc/bionic/pthread_cond.cpp
@@ -249,15 +249,18 @@
}
#if !defined(__LP64__)
-// TODO: this exists only for backward binary compatibility on 32 bit platforms.
+// This exists only for backward binary compatibility on 32 bit platforms.
+// (This is actually a _new_ function in API 28 that we could only implement for LP64.)
extern "C" int pthread_cond_timedwait_monotonic(pthread_cond_t* cond_interface,
pthread_mutex_t* mutex,
const timespec* abs_timeout) {
return pthread_cond_timedwait_monotonic_np(cond_interface, mutex, abs_timeout);
}
+#endif
-// Force this function using CLOCK_MONOTONIC because it was always using
-// CLOCK_MONOTONIC in history.
+#if !defined(__LP64__)
+// This exists only for backward binary compatibility on 32 bit platforms.
+// (This function never existed for LP64.)
extern "C" int pthread_cond_timedwait_relative_np(pthread_cond_t* cond_interface,
pthread_mutex_t* mutex,
const timespec* rel_timeout) {
@@ -269,11 +272,15 @@
}
return __pthread_cond_timedwait(__get_internal_cond(cond_interface), mutex, false, abs_timeout);
}
+#endif
+#if !defined(__LP64__)
+// This exists only for backward binary compatibility on 32 bit platforms.
+// (This function never existed for LP64.)
extern "C" int pthread_cond_timeout_np(pthread_cond_t* cond_interface,
pthread_mutex_t* mutex, unsigned ms) {
timespec ts;
timespec_from_ms(ts, ms);
return pthread_cond_timedwait_relative_np(cond_interface, mutex, &ts);
}
-#endif // !defined(__LP64__)
+#endif