summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threaddispatch.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-06 06:44:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 13:24:40 +0200
commit6e4f929296b1cfd50fc8f41f117459e65214b816 (patch)
tree9819ea160f6c745dae1936ae296709026d3d47a2 /cpukit/score/src/threaddispatch.c
parentscore: Add _Thread_queue_Is_lock_owner() (diff)
downloadrtems-6e4f929296b1cfd50fc8f41f117459e65214b816.tar.bz2
score: Introduce thread state lock
Update #2556.
Diffstat (limited to 'cpukit/score/src/threaddispatch.c')
-rw-r--r--cpukit/score/src/threaddispatch.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c
index ce5d118a22..a1f4c54f93 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -9,7 +9,7 @@
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
- * Copyright (c) 2014 embedded brains GmbH.
+ * Copyright (c) 2014, 2016 embedded brains GmbH.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -50,23 +50,22 @@ static Thread_Action *_Thread_Get_post_switch_action(
static void _Thread_Run_post_switch_actions( Thread_Control *executing )
{
- ISR_Level level;
- Per_CPU_Control *cpu_self;
- Thread_Action *action;
+ ISR_lock_Context lock_context;
+ Thread_Action *action;
- cpu_self = _Thread_Action_ISR_disable_and_acquire( executing, &level );
+ _Thread_State_acquire( executing, &lock_context );
action = _Thread_Get_post_switch_action( executing );
while ( action != NULL ) {
_Chain_Set_off_chain( &action->Node );
- ( *action->handler )( executing, action, cpu_self, level );
+ ( *action->handler )( executing, action, &lock_context );
- cpu_self = _Thread_Action_ISR_disable_and_acquire( executing, &level );
+ _Thread_State_acquire( executing, &lock_context );
action = _Thread_Get_post_switch_action( executing );
}
- _Thread_Action_release_and_ISR_enable( cpu_self, level );
+ _Thread_State_release( executing, &lock_context );
}
void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level )