diff options
author | Mathias Agopian <mathias@google.com> | 2009-07-13 22:00:33 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-07-13 22:00:33 -0700 |
commit | b7681167cbe91c2bb95cccdc08f75184ed1fb839 (patch) | |
tree | 0a8af97396d0cdd76a5698259bf1a89b0accb5b9 /libc | |
parent | a2f5e212448f36f0b35cf695d13bb4defdb4472e (diff) | |
download | bionic-b7681167cbe91c2bb95cccdc08f75184ed1fb839.zip bionic-b7681167cbe91c2bb95cccdc08f75184ed1fb839.tar.gz bionic-b7681167cbe91c2bb95cccdc08f75184ed1fb839.tar.bz2 |
allow pthread_mutexattr_setpshared to accept SHARED mutexes, since our current impl actually uses shared mutexes
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/pthread.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c index 5712840..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) |