summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/schedulersmpimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-11 13:47:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-12 09:44:44 +0200
commite97b7c9a7af2f4e19a8bdeaf13033617f8c4c2b6 (patch)
tree579598cfce50f24f2d7450e0c54f1eea6de0a023 /cpukit/include/rtems/score/schedulersmpimpl.h
parentscore: Add _ISR_lock_Set_name() (diff)
downloadrtems-e97b7c9a7af2f4e19a8bdeaf13033617f8c4c2b6.tar.bz2
score: Use an ISR lock for Per_CPU_Control::Lock
The use of a hand crafted lock for Per_CPU_Control::Lock was necessary at some point in the SMP support development, but it is no longer justified.
Diffstat (limited to 'cpukit/include/rtems/score/schedulersmpimpl.h')
-rw-r--r--cpukit/include/rtems/score/schedulersmpimpl.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpukit/include/rtems/score/schedulersmpimpl.h b/cpukit/include/rtems/score/schedulersmpimpl.h
index 0f4805d7f5..f7b5fcc1e2 100644
--- a/cpukit/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/include/rtems/score/schedulersmpimpl.h
@@ -566,13 +566,13 @@ static inline Thread_Control *_Scheduler_SMP_Preempt(
)
{
Thread_Control *victim_thread;
- ISR_lock_Context lock_context;
+ ISR_lock_Context scheduler_lock_context;
Per_CPU_Control *victim_cpu;
victim_thread = _Scheduler_Node_get_user( victim );
_Scheduler_SMP_Node_change_state( victim, SCHEDULER_SMP_NODE_READY );
- _Thread_Scheduler_acquire_critical( victim_thread, &lock_context );
+ _Thread_Scheduler_acquire_critical( victim_thread, &scheduler_lock_context );
victim_cpu = _Thread_Get_CPU( victim_thread );
@@ -580,16 +580,18 @@ static inline Thread_Control *_Scheduler_SMP_Preempt(
_Scheduler_Thread_change_state( victim_thread, THREAD_SCHEDULER_READY );
if ( victim_thread->Scheduler.helping_nodes > 0 ) {
- _Per_CPU_Acquire( victim_cpu );
+ ISR_lock_Context per_cpu_lock_context;
+
+ _Per_CPU_Acquire( victim_cpu, &per_cpu_lock_context );
_Chain_Append_unprotected(
&victim_cpu->Threads_in_need_for_help,
&victim_thread->Scheduler.Help_node
);
- _Per_CPU_Release( victim_cpu );
+ _Per_CPU_Release( victim_cpu, &per_cpu_lock_context );
}
}
- _Thread_Scheduler_release_critical( victim_thread, &lock_context );
+ _Thread_Scheduler_release_critical( victim_thread, &scheduler_lock_context );
_Scheduler_SMP_Allocate_processor(
context,