From 0d01826880f2f109eee2f029b9fdca9faf7bbdb8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 5 Jul 2013 15:18:24 +0200 Subject: psxtests/psxcleanup: Fix cleanup push/pop test The pthread_cleanup_push() and pthread_cleanup_pop() statements must appear as a pair in the same lexical scope as required by POSIX. --- testsuites/psxtests/psxcleanup/psxcleanup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/testsuites/psxtests/psxcleanup/psxcleanup.c b/testsuites/psxtests/psxcleanup/psxcleanup.c index ba13a40ca5..568e897a76 100644 --- a/testsuites/psxtests/psxcleanup/psxcleanup.c +++ b/testsuites/psxtests/psxcleanup/psxcleanup.c @@ -209,13 +209,12 @@ void *WriterThread(void *arg) puts("cleanup push for write"); pthread_cleanup_push(release_write_lock, &l->lock); + /* Thread has write lock. */ + release_write_lock(&l->lock); + /* do nothing */ puts("do nothing cleanup pop for write"); pthread_cleanup_pop(0); - - /* Thread has write lock. */ - puts("cleanup pop for write"); - pthread_cleanup_pop(1); return NULL; } -- cgit v1.2.3