From da82656065d09f7b6aa411ba361287afdd787204 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 13 May 2016 10:28:14 +0200 Subject: posix: Rework thread cancellation Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX thread cancellation to use the thread life states. Update #2555. Update #2626. --- cpukit/score/include/rtems/score/threadimpl.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cpukit/score/include/rtems/score/threadimpl.h') diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 6f97ca9866..549ca7ac35 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -205,6 +205,12 @@ bool _Thread_Restart_other( void _Thread_Yield( Thread_Control *executing ); +Thread_Life_state _Thread_Change_life( + Thread_Life_state clear, + Thread_Life_state set, + Thread_Life_state ignore +); + Thread_Life_state _Thread_Set_life_protection( Thread_Life_state state ); /** @@ -933,7 +939,8 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_change_allowed( Thread_Life_state life_state ) { - return ( life_state & THREAD_LIFE_PROTECTED ) == 0; + return ( life_state + & ( THREAD_LIFE_PROTECTED | THREAD_LIFE_CHANGE_DEFERRED ) ) == 0; } RTEMS_INLINE_ROUTINE bool _Thread_Is_life_changing( -- cgit v1.2.3