diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-06 06:44:41 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-12 13:24:40 +0200 |
commit | 6e4f929296b1cfd50fc8f41f117459e65214b816 (patch) | |
tree | 9819ea160f6c745dae1936ae296709026d3d47a2 /cpukit/rtems/src/taskmode.c | |
parent | score: Add _Thread_queue_Is_lock_owner() (diff) | |
download | rtems-6e4f929296b1cfd50fc8f41f117459e65214b816.tar.bz2 |
score: Introduce thread state lock
Update #2556.
Diffstat (limited to 'cpukit/rtems/src/taskmode.c')
-rw-r--r-- | cpukit/rtems/src/taskmode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c index e2dc7ed9d8..2f8f354b16 100644 --- a/cpukit/rtems/src/taskmode.c +++ b/cpukit/rtems/src/taskmode.c @@ -32,6 +32,7 @@ rtems_status_code rtems_task_mode( rtems_mode *previous_mode_set ) { + ISR_lock_Context lock_context; Thread_Control *executing; RTEMS_API_Control *api; ASR_Information *asr; @@ -102,18 +103,19 @@ rtems_status_code rtems_task_mode( if ( _ASR_Swap_signals( asr ) != 0 ) { needs_asr_dispatching = true; + _Thread_State_acquire( executing, &lock_context ); _Thread_Add_post_switch_action( executing, &api->Signal_action, _Signal_Action_handler ); + _Thread_State_release( executing, &lock_context ); } } } if ( preempt_enabled || needs_asr_dispatching ) { Per_CPU_Control *cpu_self; - ISR_lock_Context lock_context; cpu_self = _Thread_Dispatch_disable(); _Scheduler_Acquire( executing, &lock_context ); |