summaryrefslogtreecommitdiff
path: root/nptl/tst-robust1.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2006-07-29 23:12:43 +0000
committerRoland McGrath <roland@gnu.org>2006-07-29 23:12:43 +0000
commitab5823b4b6e760345d347b98830ccc75aa81bff6 (patch)
treef9b25d5f9a16e7ce0318aaf3adcccec0e83fd804 /nptl/tst-robust1.c
parentaa583d2ff9fca922771d88f1afa255847f2aa4ed (diff)
Updated to fedora-glibc-20060729T2255cvs/fedora-glibc-2_4_90-14
Diffstat (limited to 'nptl/tst-robust1.c')
-rw-r--r--nptl/tst-robust1.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/nptl/tst-robust1.c b/nptl/tst-robust1.c
index 9806ca467a..bc48700e4a 100644
--- a/nptl/tst-robust1.c
+++ b/nptl/tst-robust1.c
@@ -97,6 +97,30 @@ do_test (void)
puts ("mutexattr_setrobust failed");
return 1;
}
+
+#ifdef ENABLE_PI
+ if (pthread_mutexattr_setprotocol (&a, PTHREAD_PRIO_INHERIT) != 0)
+ {
+ puts ("pthread_mutexattr_setprotocol failed");
+ return 1;
+ }
+ else
+ {
+ int e = pthread_mutex_init (&m1, &a);
+ if (e == ENOTSUP)
+ {
+ puts ("PI robust mutexes not supported");
+ return 0;
+ }
+ else if (e != 0)
+ {
+ puts ("mutex_init m1 failed");
+ return 1;
+ }
+ pthread_mutex_destroy (&m1);
+ }
+#endif
+
#ifndef NOT_CONSISTENT
if (pthread_mutex_init (&m1, &a) != 0)
{
@@ -236,14 +260,14 @@ do_test (void)
e = pthread_mutex_unlock (&m1);
if (e != 0)
{
- printf ("%ld: mutex_unlock m1 failed\n", round);
+ printf ("%ld: mutex_unlock m1 failed with %d\n", round, e);
return 1;
}
e = pthread_mutex_unlock (&m2);
if (e != 0)
{
- printf ("%ld: mutex_unlock m2 failed\n", round);
+ printf ("%ld: mutex_unlock m2 failed with %d\n", round, e);
return 1;
}