diff options
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/watchdog.h | 4 | ||||
-rw-r--r-- | cpukit/score/src/thread.c | 19 |
2 files changed, 12 insertions, 11 deletions
diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h index c7665bfea2..70de7018dd 100644 --- a/cpukit/score/include/rtems/score/watchdog.h +++ b/cpukit/score/include/rtems/score/watchdog.h @@ -104,8 +104,8 @@ typedef struct { * during an insert on a watchdog delta chain. */ -volatile unsigned32 _Watchdog_Sync_level; -volatile unsigned32 _Watchdog_Sync_count; +EXTERN volatile unsigned32 _Watchdog_Sync_level; +EXTERN volatile unsigned32 _Watchdog_Sync_count; /* * The following defines the watchdog chains which are managed diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c index 2d9fc33e6b..a181780e52 100644 --- a/cpukit/score/src/thread.c +++ b/cpukit/score/src/thread.c @@ -588,19 +588,20 @@ void _Thread_Handler( void ) executing = _Thread_Executing; - _Thread_Dispatch_disable_level = 0; - /* - * Do the 'begin' here instead of after the context switch. - * This ensures 'switch' extensions can not be called before - * 'begin' extensions. + * Take care that 'begin' extensions get to complete before + * 'switch' extensions can run. This means must keep dispatch + * disabled until all 'begin' extensions complete. */ - + _User_extensions_Task_begin( executing ); + + /* + * At this point, the dispatch disable level BETTER be 1. + */ - if ( _Thread_Is_context_switch_necessary() ) - _Thread_Dispatch(); - + _Thread_Enable_dispatch(); + (*executing->Start.entry_point)( executing->Start.initial_argument ); _User_extensions_Task_exitted( executing ); |