[PATCH 4/9] Support setting elision in pthread_mutexattr_settype
Andi Kleen
andi@firstfloor.org
Tue Jun 18 21:51:00 GMT 2013
From: Andi Kleen <ak@linux.intel.com>
2013-06-18 Andi Kleen <ak@linux.intel.com>
* pthread_mutexattr_settype.c (__pthread_mutexattr_settype):
Support elision flags.
---
nptl/pthread_mutexattr_settype.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/nptl/pthread_mutexattr_settype.c b/nptl/pthread_mutexattr_settype.c
index 7b476e9..92772e6 100644
--- a/nptl/pthread_mutexattr_settype.c
+++ b/nptl/pthread_mutexattr_settype.c
@@ -26,8 +26,12 @@ __pthread_mutexattr_settype (attr, kind)
int kind;
{
struct pthread_mutexattr *iattr;
+ int mkind = kind & ~PTHREAD_MUTEX_ELISION_FLAGS_NP;
- if (kind < PTHREAD_MUTEX_NORMAL || kind > PTHREAD_MUTEX_ADAPTIVE_NP)
+ if (mkind < PTHREAD_MUTEX_NORMAL || mkind > PTHREAD_MUTEX_ADAPTIVE_NP)
+ return EINVAL;
+ /* Cannot set multiple flags. */
+ if ((kind & PTHREAD_MUTEX_ELISION_FLAGS_NP) == PTHREAD_MUTEX_ELISION_FLAGS_NP)
return EINVAL;
iattr = (struct pthread_mutexattr *) attr;
--
1.8.1.4
More information about the Libc-alpha
mailing list