From 35264d14426e1e3ca7b595db1de76208374b56e3 Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Sun, 15 Feb 2015 17:33:31 +0100 Subject: Make error checking effective in nptl/tst-cond25.c. --- nptl/tst-cond25.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'nptl') diff --git a/nptl/tst-cond25.c b/nptl/tst-cond25.c index d80d8f7e76..be0bec484d 100644 --- a/nptl/tst-cond25.c +++ b/nptl/tst-cond25.c @@ -40,7 +40,15 @@ pthread_cond_t cond; void cleanup (void *u) { - /* pthread_cond_wait should always return with the mutex locked. */ + /* pthread_cond_wait should always return with the mutex locked. The + pthread_mutex_unlock implementation does not actually check whether we + own the mutex for several mutex kinds, so check this explicitly. */ + int ret = pthread_mutex_trylock (&mutex); + if (ret != EDEADLK && ret != EBUSY) + { + printf ("mutex not locked in cleanup %d\n", ret); + abort (); + } if (pthread_mutex_unlock (&mutex)) abort (); } -- cgit 1.4.1