summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxcleanup
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-05 15:18:24 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-05 16:01:04 +0200
commit0d01826880f2f109eee2f029b9fdca9faf7bbdb8 (patch)
treee387e983b9274c709bb9bbeca4ddd88916b7c302 /testsuites/psxtests/psxcleanup
parentpsxtests/psxhdrs: Fix cleanup push/pop test (diff)
downloadrtems-0d01826880f2f109eee2f029b9fdca9faf7bbdb8.tar.bz2
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.
Diffstat (limited to 'testsuites/psxtests/psxcleanup')
-rw-r--r--testsuites/psxtests/psxcleanup/psxcleanup.c7
1 files 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;
}