diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-21 13:17:59 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-21 13:17:59 +0000 |
commit | 68799a2a8f7f3d44adfcb57a5e3d00e7448ee4b9 (patch) | |
tree | 8c2aef7e06e4e629fc01f016c6cd1e9dc8165167 /cpukit/posix/src/cancel.c | |
parent | Update for MPC55XX changes (diff) | |
download | rtems-68799a2a8f7f3d44adfcb57a5e3d00e7448ee4b9.tar.bz2 |
2009-07-21 Santosh G Vattam <vattam.santosh@gmail.com>
* posix/Makefile.am, posix/include/rtems/posix/cancel.h,
posix/src/cancel.c, posix/src/setcancelstate.c,
posix/src/setcanceltype.c: Add
_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch method to
avoid duplication of code and ease coverage analysis.
* posix/src/canceleval.c: New file.
Diffstat (limited to 'cpukit/posix/src/cancel.c')
-rw-r--r-- | cpukit/posix/src/cancel.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c index 56a574e9e4..76049fca8c 100644 --- a/cpukit/posix/src/cancel.c +++ b/cpukit/posix/src/cancel.c @@ -25,8 +25,7 @@ #include <rtems/posix/pthread.h> #include <rtems/posix/threadsup.h> -/*PAGE - * +/* * 18.2.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181 */ @@ -37,7 +36,6 @@ int pthread_cancel( Thread_Control *the_thread; POSIX_API_Control *thread_support; Objects_Locations location; - bool cancel = false; /* * Don't even think about deleting a resource from an ISR. @@ -54,13 +52,7 @@ int pthread_cancel( thread_support->cancelation_requested = 1; - if (thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && - thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS) - cancel = true; - - _Thread_Enable_dispatch(); - if ( cancel ) - _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); + _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( thread_support ); return 0; #if defined(RTEMS_MULTIPROCESSING) |