From 68799a2a8f7f3d44adfcb57a5e3d00e7448ee4b9 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 21 Jul 2009 13:17:59 +0000 Subject: 2009-07-21 Santosh G Vattam * 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. --- cpukit/posix/src/cancel.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'cpukit/posix/src/cancel.c') 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 #include -/*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) -- cgit v1.2.3