summaryrefslogtreecommitdiffstats
path: root/libc/bionic/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/pthread.c')
-rw-r--r--libc/bionic/pthread.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index ec3c459..d8a3166 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -789,7 +789,18 @@ int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared)
if (!attr)
return EINVAL;
- return (pshared == PTHREAD_PROCESS_PRIVATE) ? 0 : ENOTSUP;
+ switch (pshared) {
+ case PTHREAD_PROCESS_PRIVATE:
+ case PTHREAD_PROCESS_SHARED:
+ /* our current implementation of pthread actually supports shared
+ * mutexes but won't cleanup if a process dies with the mutex held.
+ * Nevertheless, it's better than nothing. Shared mutexes are used
+ * by surfaceflinger and audioflinger.
+ */
+ return 0;
+ }
+
+ return ENOTSUP;
}
int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared)
@@ -1204,6 +1215,7 @@ int pthread_cond_timedwait(pthread_cond_t *cond,
}
+/* this one exists only for backward binary compatibility */
int pthread_cond_timedwait_monotonic(pthread_cond_t *cond,
pthread_mutex_t * mutex,
const struct timespec *abstime)
@@ -1211,6 +1223,20 @@ int pthread_cond_timedwait_monotonic(pthread_cond_t *cond,
return __pthread_cond_timedwait(cond, mutex, abstime, CLOCK_MONOTONIC);
}
+int pthread_cond_timedwait_monotonic_np(pthread_cond_t *cond,
+ pthread_mutex_t * mutex,
+ const struct timespec *abstime)
+{
+ return __pthread_cond_timedwait(cond, mutex, abstime, CLOCK_MONOTONIC);
+}
+
+int pthread_cond_timedwait_relative_np(pthread_cond_t *cond,
+ pthread_mutex_t * mutex,
+ const struct timespec *reltime)
+{
+ return __pthread_cond_timedwait_relative(cond, mutex, reltime);
+}
+
int pthread_cond_timeout_np(pthread_cond_t *cond,
pthread_mutex_t * mutex,
unsigned msecs)