diff options
-rw-r--r-- | cpukit/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/posix/include/rtems/posix/cancel.h | 30 | ||||
-rw-r--r-- | cpukit/posix/src/cancel.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/canceleval.c | 10 | ||||
-rw-r--r-- | cpukit/posix/src/setcancelstate.c | 2 | ||||
-rw-r--r-- | cpukit/posix/src/setcanceltype.c | 2 |
6 files changed, 36 insertions, 17 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 69f2e1cfea..806c5eefac 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,10 @@ +2009-07-21 Joel Sherrill <joel.sherrill@oarcorp.com> + + * posix/include/rtems/posix/cancel.h, posix/src/cancel.c, + posix/src/canceleval.c, posix/src/setcancelstate.c, + posix/src/setcanceltype.c: Fix a minor bug in the previous + modification which resulted in psxcancel failing. + 2009-07-21 Santosh G Vattam <vattam.santosh@gmail.com> * posix/Makefile.am, posix/include/rtems/posix/cancel.h, diff --git a/cpukit/posix/include/rtems/posix/cancel.h b/cpukit/posix/include/rtems/posix/cancel.h index 228c60c7c4..04f13cea11 100644 --- a/cpukit/posix/include/rtems/posix/cancel.h +++ b/cpukit/posix/include/rtems/posix/cancel.h @@ -1,5 +1,8 @@ /** * @file rtems/posix/cancel.h + * + * This file contains the prototypes and data types used to implement + * POSIX thread cancelation. */ /* @@ -18,36 +21,41 @@ #include <rtems/posix/threadsup.h> +/** + * This structure is used to manage the cancelation handlers. + */ typedef struct { + /** This field is the Chain Node so we can put these on lists. */ Chain_Node Node; + /** This field is the cancelation routine. */ void (*routine)( void * ); + /** This field is the argument to the cancelation routine. */ void *arg; } POSIX_Cancel_Handler_control; -/* - * _POSIX_Threads_cancel_run - * - * DESCRIPTION: +/** + * @brief _POSIX_Threads_cancel_run * * This support routine runs through the chain of cancel handlers that * have been registered and executes them. + * + * @param[in] the_thread is the thread whose cancelation handlers + * should be run */ - void _POSIX_Threads_cancel_run( Thread_Control *the_thread ); -/* - * _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch +/** + * @brief _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch * - * DESCRIPTION: - * * This routine separates a piece of code that existed as part of * another routine, but had to be separated to improve coverage. + * + * @param[in] the_thread is the thread to evaluate canceling */ - void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch ( - POSIX_API_Control *thread_support + Thread_Control *the_thread ); #endif diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c index 76049fca8c..df93ffeec2 100644 --- a/cpukit/posix/src/cancel.c +++ b/cpukit/posix/src/cancel.c @@ -52,7 +52,7 @@ int pthread_cancel( thread_support->cancelation_requested = 1; - _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( thread_support ); + _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( the_thread ); return 0; #if defined(RTEMS_MULTIPROCESSING) diff --git a/cpukit/posix/src/canceleval.c b/cpukit/posix/src/canceleval.c index 72932da07f..784b91ffb6 100644 --- a/cpukit/posix/src/canceleval.c +++ b/cpukit/posix/src/canceleval.c @@ -20,10 +20,14 @@ #include <rtems/posix/pthread.h> void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( - POSIX_API_Control *thread_support + Thread_Control *the_thread ) { - bool cancel = false; + POSIX_API_Control *thread_support; + bool cancel; + + cancel = false; + thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && @@ -33,5 +37,5 @@ void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( _Thread_Enable_dispatch(); if ( cancel ) - _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); + _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } diff --git a/cpukit/posix/src/setcancelstate.c b/cpukit/posix/src/setcancelstate.c index 6d5cc30108..7b7543b639 100644 --- a/cpukit/posix/src/setcancelstate.c +++ b/cpukit/posix/src/setcancelstate.c @@ -56,7 +56,7 @@ int pthread_setcancelstate( *oldstate = thread_support->cancelability_state; thread_support->cancelability_state = state; - _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( thread_support ); + _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); /* * _Thread_Enable_dispatch is invoked by above call. diff --git a/cpukit/posix/src/setcanceltype.c b/cpukit/posix/src/setcanceltype.c index 628bc38dbc..224a8fb11d 100644 --- a/cpukit/posix/src/setcanceltype.c +++ b/cpukit/posix/src/setcanceltype.c @@ -56,7 +56,7 @@ int pthread_setcanceltype( *oldtype = thread_support->cancelability_type; thread_support->cancelability_type = type; - _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( thread_support ); + _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); /* * _Thread_Enable_dispatch is invoked by above call. |