This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 05/10] Support setting elision in pthread_mutexattr_settype


From: Andi Kleen <ak@linux.intel.com>

2013-01-10  Andi Kleen  <ak@linux.intel.com>

	* pthread_mutexattr_settype.c (__pthread_mutexattr_settype):
        Support elision flags.
---
 nptl/pthread_mutexattr_settype.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/nptl/pthread_mutexattr_settype.c b/nptl/pthread_mutexattr_settype.c
index 7b476e9..05551ee 100644
--- a/nptl/pthread_mutexattr_settype.c
+++ b/nptl/pthread_mutexattr_settype.c
@@ -26,8 +26,11 @@ __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_TIMED_NO_ELISION_NP)
+    return EINVAL;
+  if ((kind & PTHREAD_MUTEX_ELISION_FLAGS_NP) == PTHREAD_MUTEX_ELISION_FLAGS_NP)
     return EINVAL;
 
   iattr = (struct pthread_mutexattr *) attr;
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]