allow pthread_mutexattr_setpshared to accept SHARED mutexes, since our current impl actually uses shared mutexes
This commit is contained in:
parent
a2f5e21244
commit
b7681167cb
@ -789,7 +789,18 @@ int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared)
|
|||||||
if (!attr)
|
if (!attr)
|
||||||
return EINVAL;
|
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)
|
int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user