diff options
Diffstat (limited to 'cpukit/score/src/threadhandler.c')
-rw-r--r-- | cpukit/score/src/threadhandler.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c index 84618751fd..e23667c32f 100644 --- a/cpukit/score/src/threadhandler.c +++ b/cpukit/score/src/threadhandler.c @@ -58,7 +58,7 @@ void _Thread_Handler( void ) { ISR_Level level; Thread_Control *executing; -#if defined(__USE_INIT_FINI__) +#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__) static char doneConstructors; char doneCons; #endif @@ -73,7 +73,7 @@ void _Thread_Handler( void ) level = executing->Start.isr_level; _ISR_Set_level(level); -#if defined(__USE_INIT_FINI__) +#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__) doneCons = doneConstructors; doneConstructors = 1; #endif @@ -95,6 +95,11 @@ void _Thread_Handler( void ) if (!doneCons) _init (); #endif +#if defined(__USE__MAIN__) + if (!doneCons) + __main (); +#endif + switch ( executing->Start.prototype ) { case THREAD_START_NUMERIC: |