mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
Make error checking effective in nptl/tst-cond25.c.
This commit is contained in:
parent
6f49e32aa5
commit
35264d1442
@ -1,3 +1,8 @@
|
||||
2015-02-16 Torvald Riegel <triegel@redhat.com>
|
||||
|
||||
* nptl/tst-cond25.c (cleanup): Explicitly check that the mutex is
|
||||
acquired.
|
||||
|
||||
2015-02-15 Matthew Fortune <Matthew.Fortune@imgtec.com>
|
||||
|
||||
[BZ #17792]
|
||||
|
@ -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 ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user