summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/setcanceltype.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/setcanceltype.c')
-rw-r--r--cpukit/posix/src/setcanceltype.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/cpukit/posix/src/setcanceltype.c b/cpukit/posix/src/setcanceltype.c
index 403e16b812..628bc38dbc 100644
--- a/cpukit/posix/src/setcanceltype.c
+++ b/cpukit/posix/src/setcanceltype.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2008.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -20,13 +20,11 @@
#include <rtems/score/chain.h>
#include <rtems/score/isr.h>
#include <rtems/score/thread.h>
-#include <rtems/score/wkspace.h>
#include <rtems/posix/cancel.h>
#include <rtems/posix/pthread.h>
#include <rtems/posix/threadsup.h>
-/*PAGE
- *
+/*
* 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183
*/
@@ -36,7 +34,6 @@ int pthread_setcanceltype(
)
{
POSIX_API_Control *thread_support;
- bool cancel = false;
/*
* Don't even think about deleting a resource from an ISR.
@@ -59,13 +56,10 @@ int pthread_setcanceltype(
*oldtype = thread_support->cancelability_type;
thread_support->cancelability_type = type;
- if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
- thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
- thread_support->cancelation_requested )
- cancel = true;
- _Thread_Enable_dispatch();
- if ( cancel )
- _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED );
-
+ _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( thread_support );
+
+ /*
+ * _Thread_Enable_dispatch is invoked by above call.
+ */
return 0;
}