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 08/11] Fix tst-mutexpi8


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

tst-mutexpi8 didn't actually test PI because tst-mutex8 didn't have any
code to enable priority inheritance. Add the needed code in a ifdef.

This also fixes it for lock elision because priority inheritance turns
off elision, so we don't need to explicitely disable it.

2013-05-16  Andi Kleen  <ak@linux.intel.com>

	* tst-mutex8.c: Check for ENABLE_PI
	* tst-mutexpi8.c:  Set TYPE to PTHREAD_MUTEX_TIMED_NP.
---
 nptl/tst-mutex8.c   | 8 +++++++-
 nptl/tst-mutexpi8.c | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/nptl/tst-mutex8.c b/nptl/tst-mutex8.c
index 943ada6..6b74a3e 100644
--- a/nptl/tst-mutex8.c
+++ b/nptl/tst-mutex8.c
@@ -348,7 +348,13 @@ do_test (void)
       puts ("0th mutexattr_settype failed");
       return 1;
     }
-
+#ifdef ENABLE_PI
+  if (pthread_mutexattr_setprotocol (&ma, PTHREAD_PRIO_INHERIT))
+    {
+      puts ("pthread_mutexattr_setprotocol2 failed");
+      return 1;
+    }
+#endif
   puts ("check " NAME " mutex");
   int res = check_type (NAME, &ma);
 #else
diff --git a/nptl/tst-mutexpi8.c b/nptl/tst-mutexpi8.c
index cea6030..4aae694 100644
--- a/nptl/tst-mutexpi8.c
+++ b/nptl/tst-mutexpi8.c
@@ -1,2 +1,3 @@
+#define TYPE PTHREAD_MUTEX_TIMED_NP
 #define ENABLE_PI 1
 #include "tst-mutex8.c"
-- 
1.8.1.4


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