summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadinitialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/threadinitialize.c')
-rw-r--r--cpukit/score/src/threadinitialize.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 4afdbcb821..eda6f6bb5a 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -23,6 +23,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/object.h>
#include <rtems/score/priority.h>
+#include <rtems/score/scheduler.h>
#include <rtems/score/states.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/thread.h>
@@ -60,6 +61,7 @@ bool _Thread_Initialize(
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
void *fp_area;
#endif
+ void *sched = NULL;
void *extensions_area;
bool extension_status;
int i;
@@ -192,6 +194,9 @@ bool _Thread_Initialize(
the_thread->resource_count = 0;
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
+ sched =_Scheduler_Thread_scheduler_allocate( &_Scheduler, the_thread );
+ if ( !sched )
+ goto failed;
_Thread_Set_priority( the_thread, priority );
/*
@@ -235,6 +240,9 @@ failed:
(void) _Workspace_Free( fp_area );
#endif
+ if ( sched )
+ (void) _Workspace_Free( sched );
+
_Thread_Stack_Free( the_thread );
return false;