summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems/posix/threadsup.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-12-02 08:33:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-12-02 09:24:51 +0100
commit927a0a1f990c19a3e7295bb001896b3f3c75a77e (patch)
treeb4c1cdb1a406b700a17b80e235613c9ced8c0cd9 /cpukit/posix/include/rtems/posix/threadsup.h
parentpstmtests_plan.csv: Update to reflect psxtmcond 09 and 10 exit (diff)
downloadrtems-927a0a1f990c19a3e7295bb001896b3f3c75a77e.tar.bz2
posix: Use cleanup contexts on the stack
Provide support for latest Newlib <pthread.h> change. The cleanup contexts are stored on the thread stack. This is conformant with the POSIX requirements for the pthread_cleanup_push() and pthread_cleanup_pop() statement pair. Passing an invalid pointer as the routine to pthread_cleanup_push() is now a usage error and the behaviour is undefined.
Diffstat (limited to 'cpukit/posix/include/rtems/posix/threadsup.h')
-rw-r--r--cpukit/posix/include/rtems/posix/threadsup.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h
index 7bd1f934ad..6bb3b844cc 100644
--- a/cpukit/posix/include/rtems/posix/threadsup.h
+++ b/cpukit/posix/include/rtems/posix/threadsup.h
@@ -80,8 +80,15 @@ typedef struct {
int cancelability_type;
/** This indicates if a cancelation has been requested. */
int cancelation_requested;
+#ifndef HAVE_STRUCT__PTHREAD_CLEANUP_CONTEXT
/** This is the set of cancelation handlers. */
Chain_Control Cancellation_Handlers;
+#else /* HAVE_STRUCT__PTHREAD_CLEANUP_CONTEXT */
+ /**
+ * @brief LIFO list of cleanup contexts.
+ */
+ struct _pthread_cleanup_context *last_cleanup_context;
+#endif /* HAVE_STRUCT__PTHREAD_CLEANUP_CONTEXT */
/**
* This is the thread key value chain's control, which is used