diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-10-10 16:03:38 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-10-10 16:03:38 +0000 |
commit | 171bbec50871de9b60ae87c460bbfceebc26f769 (patch) | |
tree | 7bd0ac9e75dd10f9f1196f504dd603c3212ebf8b /cpukit | |
parent | 2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-171bbec50871de9b60ae87c460bbfceebc26f769.tar.bz2 |
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/include/rtems/posix/threadsup.h, posix/src/cancel.c,
posix/src/canceleval.c: Make psxcancel run again.
_POSIX_Thread_Exit() can be called on running thread or another
thread when it is cancelled.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/posix/include/rtems/posix/threadsup.h | 2 | ||||
-rw-r--r-- | cpukit/posix/src/cancel.c | 1 | ||||
-rw-r--r-- | cpukit/posix/src/canceleval.c | 13 |
4 files changed, 14 insertions, 9 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index ab455e972a..724bf13de3 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,12 @@ 2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com> + * posix/include/rtems/posix/threadsup.h, posix/src/cancel.c, + posix/src/canceleval.c: Make psxcancel run again. + _POSIX_Thread_Exit() can be called on running thread or another + thread when it is cancelled. + +2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com> + * posix/src/mqueuetimedreceive.c, posix/src/mqueuetimedsend.c, posix/src/mutextimedlock.c, posix/src/prwlocktimedrdlock.c, posix/src/prwlocktimedwrlock.c, posix/src/semtimedwait.c: Switch from diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h index 673ee0ed12..e0d5ce9132 100644 --- a/cpukit/posix/include/rtems/posix/threadsup.h +++ b/cpukit/posix/include/rtems/posix/threadsup.h @@ -81,7 +81,7 @@ typedef struct { void _POSIX_Thread_Exit( Thread_Control *the_thread, void *value_ptr -) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; +); #endif /* end of include file */ diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c index df93ffeec2..6058ff2605 100644 --- a/cpukit/posix/src/cancel.c +++ b/cpukit/posix/src/cancel.c @@ -52,6 +52,7 @@ int pthread_cancel( thread_support->cancelation_requested = 1; + /* This enables dispatch implicitly */ _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( the_thread ); return 0; diff --git a/cpukit/posix/src/canceleval.c b/cpukit/posix/src/canceleval.c index 784b91ffb6..3903ca1b1d 100644 --- a/cpukit/posix/src/canceleval.c +++ b/cpukit/posix/src/canceleval.c @@ -24,18 +24,15 @@ void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( ) { 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 && - thread_support->cancelation_requested ) - cancel = true; - - _Thread_Enable_dispatch(); - - if ( cancel ) + thread_support->cancelation_requested ) { + _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); + } else + _Thread_Enable_dispatch(); + } |