summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulersmp.c
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/score/src/schedulersmp.c
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/score/src/schedulersmp.c')
-rw-r--r--cpukit/score/src/schedulersmp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/cpukit/score/src/schedulersmp.c b/cpukit/score/src/schedulersmp.c
index d68ac4fc8b..a498bda90a 100644
--- a/cpukit/score/src/schedulersmp.c
+++ b/cpukit/score/src/schedulersmp.c
@@ -14,25 +14,26 @@
void _Scheduler_Request_ask_for_help( Thread_Control *the_thread )
{
- ISR_lock_Context lock_context;
+ ISR_lock_Context scheduler_lock_context;
- _Thread_Scheduler_acquire_critical( the_thread, &lock_context );
+ _Thread_Scheduler_acquire_critical( the_thread, &scheduler_lock_context );
if ( _Chain_Is_node_off_chain( &the_thread->Scheduler.Help_node ) ) {
- Per_CPU_Control *cpu;
+ Per_CPU_Control *cpu;
+ ISR_lock_Context per_cpu_lock_context;
cpu = _Thread_Get_CPU( the_thread );
- _Per_CPU_Acquire( cpu );
+ _Per_CPU_Acquire( cpu, &per_cpu_lock_context );
_Chain_Append_unprotected(
&cpu->Threads_in_need_for_help,
&the_thread->Scheduler.Help_node
);
- _Per_CPU_Release( cpu );
+ _Per_CPU_Release( cpu, &per_cpu_lock_context );
_Thread_Dispatch_request( _Per_CPU_Get(), cpu );
}
- _Thread_Scheduler_release_critical( the_thread, &lock_context );
+ _Thread_Scheduler_release_critical( the_thread, &scheduler_lock_context );
}