diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-02-28 17:52:33 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2016-02-28 17:52:33 +0000 |
commit | 1bdbd705993eab79189dff87b69a9cff5c69b17e (patch) | |
tree | 93354adb0a612a635964c8498072087760a0f93b /lib/libthr/thread/thr_mutexattr.c | |
parent | 3f3af790f95027d0c3b859a53eb82ef5d00dc4f8 (diff) |
Notes
Diffstat (limited to 'lib/libthr/thread/thr_mutexattr.c')
-rw-r--r-- | lib/libthr/thread/thr_mutexattr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libthr/thread/thr_mutexattr.c b/lib/libthr/thread/thr_mutexattr.c index 7c48ed2263dc..fa349cfc756b 100644 --- a/lib/libthr/thread/thr_mutexattr.c +++ b/lib/libthr/thread/thr_mutexattr.c @@ -176,8 +176,7 @@ _pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, if (attr == NULL || *attr == NULL) return (EINVAL); - - *pshared = PTHREAD_PROCESS_PRIVATE; + *pshared = (*attr)->m_pshared; return (0); } @@ -185,13 +184,11 @@ int _pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared) { - if (attr == NULL || *attr == NULL) + if (attr == NULL || *attr == NULL || + (pshared != PTHREAD_PROCESS_PRIVATE && + pshared != PTHREAD_PROCESS_SHARED)) return (EINVAL); - - /* Only PTHREAD_PROCESS_PRIVATE is supported. */ - if (pshared != PTHREAD_PROCESS_PRIVATE) - return (EINVAL); - + (*attr)->m_pshared = pshared; return (0); } |