[rtems commit] psxtests/psxcleanup: Fix cleanup push/pop test

Sebastian Huber sebh at rtems.org
Fri Jul 5 13:56:39 UTC 2013


Module:    rtems
Branch:    master
Commit:    0d01826880f2f109eee2f029b9fdca9faf7bbdb8
Changeset: http://git.rtems.org/rtems/commit/?id=0d01826880f2f109eee2f029b9fdca9faf7bbdb8

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jul  5 15:18:24 2013 +0200

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 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/testsuites/psxtests/psxcleanup/psxcleanup.c b/testsuites/psxtests/psxcleanup/psxcleanup.c
index ba13a40..568e897 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;
 }
 




More information about the vc mailing list