forked from Imagelibrary/rtems
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user