diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 09:15:04 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:57:25 +0200 |
commit | 47ac81f645aba2fba985fa991f532173e6dd5b78 (patch) | |
tree | 53b48f45318df093ce21aa79ceaaf4e797443511 /cpukit/posix/src/testcancel.c | |
parent | sptests/sp37: Disable dispatch for clock tick (diff) | |
download | rtems-47ac81f645aba2fba985fa991f532173e6dd5b78.tar.bz2 |
posix: Obtain _Thread_Executing in proper context
Diffstat (limited to 'cpukit/posix/src/testcancel.c')
-rw-r--r-- | cpukit/posix/src/testcancel.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/posix/src/testcancel.c b/cpukit/posix/src/testcancel.c index f999fe54a9..876f62c768 100644 --- a/cpukit/posix/src/testcancel.c +++ b/cpukit/posix/src/testcancel.c @@ -37,6 +37,7 @@ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; + Thread_Control *executing; bool cancel = false; /* @@ -48,14 +49,15 @@ void pthread_testcancel( void ) if ( _ISR_Is_in_progress() ) return; - thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; - _Thread_Disable_dispatch(); + executing = _Thread_Executing; + thread_support = executing->API_Extensions[ THREAD_API_POSIX ]; + if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); if ( cancel ) - _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); + _POSIX_Thread_Exit( executing, PTHREAD_CANCELED ); } |