summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/setcanceltype.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/setcanceltype.c')
-rw-r--r--cpukit/posix/src/setcanceltype.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/posix/src/setcanceltype.c b/cpukit/posix/src/setcanceltype.c
index f97affa8fb..9398c22cea 100644
--- a/cpukit/posix/src/setcanceltype.c
+++ b/cpukit/posix/src/setcanceltype.c
@@ -39,6 +39,7 @@ int pthread_setcanceltype(
)
{
POSIX_API_Control *thread_support;
+ Thread_Control *executing;
/*
* Don't even think about deleting a resource from an ISR.
@@ -55,13 +56,15 @@ int pthread_setcanceltype(
if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS )
return EINVAL;
- thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
-
_Thread_Disable_dispatch();
+
+ executing = _Thread_Executing;
+ thread_support = executing ->API_Extensions[ THREAD_API_POSIX ];
+
*oldtype = thread_support->cancelability_type;
thread_support->cancelability_type = type;
- _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing);
+ _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( executing );
/*
* _Thread_Enable_dispatch is invoked by above call.