diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-25 19:08:52 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-26 09:23:02 +0100 |
commit | 1ac4a85ebf0cd0e788c2d5374c635087c33de0bf (patch) | |
tree | 55e5da6a482cc00eb616c6d01b9f2732900ab2b4 /cpukit/score/src/mpci.c | |
parent | libtest: Print SHA256 hash in base64url (diff) | |
download | rtems-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/mpci.c')
-rw-r--r-- | cpukit/score/src/mpci.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index 91d0eb0214..cb306c9763 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -126,7 +126,7 @@ static void _MPCI_Create_server( void ) } }; Thread_Configuration config; - bool ok; + Status_Control status; ISR_lock_Context lock_context; @@ -152,13 +152,12 @@ static void _MPCI_Create_server( void ) + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE; config.stack_area = _MPCI_Receive_server_stack; - ok = _Thread_Initialize( + status = _Thread_Initialize( &_Thread_Information, _MPCI_Receive_server_tcb, &config ); - _Assert( ok ); - (void) ok; + _Assert_Unused_variable_equals( status, STATUS_SUCCESSFUL ); _ISR_lock_ISR_disable( &lock_context ); _Thread_Start( _MPCI_Receive_server_tcb, &entry, &lock_context ); |