diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-20 11:01:55 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-20 11:03:38 +0200 |
commit | 518d82b6d39922eff34ee2eb7bd4df2a73ad2c1e (patch) | |
tree | e90eafaf3e2bfa607cf32365a73fadca77789185 /cpukit | |
parent | add compare_and_swap check in check-atomic.m4 (diff) | |
download | rtems-518d82b6d39922eff34ee2eb7bd4df2a73ad2c1e.tar.bz2 |
smp: Disable restart of threads other than self
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/score/src/threadrestart.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c index 726cfa90cf..85803d8439 100644 --- a/cpukit/score/src/threadrestart.c +++ b/cpukit/score/src/threadrestart.c @@ -20,6 +20,7 @@ #include <rtems/score/threadimpl.h> #include <rtems/score/userextimpl.h> +#include <rtems/config.h> bool _Thread_Restart( Thread_Control *the_thread, @@ -27,6 +28,15 @@ bool _Thread_Restart( Thread_Entry_numeric_type numeric_argument ) { +#if defined( RTEMS_SMP ) + if ( + rtems_configuration_is_smp_enabled() + && !_Thread_Is_executing( the_thread ) + ) { + return false; + } +#endif + if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); |