diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-13 07:04:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-20 07:49:38 +0200 |
commit | 938839077741d2eac82d9d86705c16e0b9de8379 (patch) | |
tree | cf426c86ed7751264c0ff3db600627cbbfda99ff /cpukit/score/src/threadglobalconstruction.c | |
parent | score: Add _Thread_Dispatch_disable_with_CPU() (diff) | |
download | rtems-938839077741d2eac82d9d86705c16e0b9de8379.tar.bz2 |
score: Split _Thread_Restart()
Split _Thread_Restart() into _Thread_Restart_self() and
_Thread_Restart_other(). Move content of existing
_Thread_Restart_self() into new _Thread_Restart_self(). Avoid Giant
lock for thread restart. _Thread_Restart_self() is a no-return function
and used by _Thread_Global_construction().
Update #2555.
Update #2626.
Diffstat (limited to 'cpukit/score/src/threadglobalconstruction.c')
-rw-r--r-- | cpukit/score/src/threadglobalconstruction.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cpukit/score/src/threadglobalconstruction.c b/cpukit/score/src/threadglobalconstruction.c index 997f285a67..7ce1862d8c 100644 --- a/cpukit/score/src/threadglobalconstruction.c +++ b/cpukit/score/src/threadglobalconstruction.c @@ -20,8 +20,6 @@ #endif #include <rtems/score/threadimpl.h> -#include <rtems/score/assert.h> -#include <rtems/config.h> /* * Conditional magic to determine what style of C++ constructor @@ -49,6 +47,8 @@ void _Thread_Global_construction( const Thread_Entry_information *entry ) { + ISR_lock_Context lock_context; + #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) /* * _init could be a weak symbol and we SHOULD test it but it isn't @@ -58,8 +58,6 @@ void _Thread_Global_construction( INIT_NAME(); #endif - _Thread_Disable_dispatch(); - _Thread_Restart( executing, executing, entry ); - _Thread_Enable_dispatch(); - RTEMS_UNREACHABLE(); + _ISR_lock_ISR_disable( &lock_context ); + _Thread_Restart_self( _Thread_Executing, entry, &lock_context ); } |