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.
This commit is contained in:
Sebastian Huber
2013-07-05 15:18:24 +02:00
parent 5e2a66d5c9
commit 0d01826880

View File

@@ -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;
}