summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadclearstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/threadclearstate.c')
-rw-r--r--cpukit/score/src/threadclearstate.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/cpukit/score/src/threadclearstate.c b/cpukit/score/src/threadclearstate.c
index 19e41df593..c60fb8fc41 100644
--- a/cpukit/score/src/threadclearstate.c
+++ b/cpukit/score/src/threadclearstate.c
@@ -26,19 +26,20 @@ void _Thread_Clear_state(
States_Control state
)
{
- ISR_Level level;
- States_Control current_state;
+ ISR_lock_Context lock_context;
+ States_Control current_state;
- _ISR_Disable( level );
- current_state = the_thread->current_state;
+ _Scheduler_Acquire( the_thread, &lock_context );
- if ( current_state & state ) {
- current_state =
- the_thread->current_state = _States_Clear( state, current_state );
+ current_state = the_thread->current_state;
+ if ( current_state & state ) {
+ current_state =
+ the_thread->current_state = _States_Clear( state, current_state );
- if ( _States_Is_ready( current_state ) ) {
- _Scheduler_Unblock( the_thread );
- }
+ if ( _States_Is_ready( current_state ) ) {
+ _Scheduler_Unblock( the_thread );
+ }
}
- _ISR_Enable( level );
+
+ _Scheduler_Release( the_thread, &lock_context );
}