summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-29 09:50:47 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-29 09:50:47 +0200
commit9bb3ce3918261c5392abbe4b65902e5d4b6dff07 (patch)
treea0ce25f5619672f3afd222cfe79460e88858d2da /cpukit/score/include/rtems/score/threadimpl.h
parentarm/raspberrypi: resolve BSP warnings. (diff)
downloadrtems-9bb3ce3918261c5392abbe4b65902e5d4b6dff07.tar.bz2
score: Fix SMP message handling
According to the C11 standard only atomic read-modify-write operations guarantee that the last value written in modification order is read, see "7.17.3 Order and consistency". Thus we must use a read-modify-write in _SMP_Inter_processor_interrupt_handler() to make sure we read an up-to-date message.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 6bb78158e3..c878266c58 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -844,11 +844,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_update_heir(
cpu_for_heir->heir = heir;
- if ( cpu_for_heir == cpu_self ) {
- cpu_self->dispatch_necessary = true;
- } else {
- _Per_CPU_Send_interrupt( cpu_for_heir );
- }
+ _Thread_Dispatch_request( cpu_self, cpu_for_heir );
}
#endif
@@ -885,15 +881,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Add_post_switch_action(
action->handler = handler;
-#if defined(RTEMS_SMP)
- if ( _Per_CPU_Get() == cpu_of_thread ) {
- cpu_of_thread->dispatch_necessary = true;
- } else {
- _Per_CPU_Send_interrupt( cpu_of_thread );
- }
-#else
- cpu_of_thread->dispatch_necessary = true;
-#endif
+ _Thread_Dispatch_request( _Per_CPU_Get(), cpu_of_thread );
_Chain_Append_if_is_off_chain_unprotected(
&the_thread->Post_switch_actions.Chain,