summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadcreateidle.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-25 19:08:52 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-02-26 09:23:02 +0100
commit1ac4a85ebf0cd0e788c2d5374c635087c33de0bf (patch)
tree55e5da6a482cc00eb616c6d01b9f2732900ab2b4 /cpukit/score/src/threadcreateidle.c
parentlibtest: Print SHA256 hash in base64url (diff)
downloadrtems-1ac4a85ebf0cd0e788c2d5374c635087c33de0bf.tar.bz2
score: Fix thread initialization
Close the thread object if a thread create extension fails. Also call the delete extension to avoid resource leaks in early extensions if a late extension fails. Close #4270.
Diffstat (limited to 'cpukit/score/src/threadcreateidle.c')
-rw-r--r--cpukit/score/src/threadcreateidle.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index 04a103cf14..395dcc9c12 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -34,7 +34,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
{
Thread_Configuration config;
Thread_Control *idle;
- bool ok;
+ Status_Control status;
memset( &config, 0, sizeof( config ) );
config.scheduler = _Scheduler_Get_by_CPU( cpu );
@@ -67,9 +67,8 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
idle = _Thread_Internal_allocate();
_Assert( idle != NULL );
- ok = _Thread_Initialize( &_Thread_Information, idle, &config );
- _Assert( ok );
- (void) ok;
+ status = _Thread_Initialize( &_Thread_Information, idle, &config );
+ _Assert_Unused_variable_equals( status, STATUS_SUCCESSFUL );
/*
* WARNING!!! This is necessary to "kick" start the system and