summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score
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/include/rtems/score
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/include/rtems/score')
-rw-r--r--cpukit/include/rtems/score/threadimpl.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index 0c7df47f36..1e7d58609f 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -201,16 +201,32 @@ typedef struct {
* @param the_thread The thread to initialize.
* @param config The configuration of the thread to initialize.
*
- * @retval true The thread initialization was successful.
- * @retval false The thread initialization failed.
+ * @retval STATUS_SUCCESSFUL The thread initialization was successful.
+ *
+ * @retval STATUS_UNSATISFIED The thread initialization failed.
*/
-bool _Thread_Initialize(
+Status_Control _Thread_Initialize(
Thread_Information *information,
Thread_Control *the_thread,
const Thread_Configuration *config
);
/**
+ * @brief Frees the thread.
+ *
+ * This routine invokes the thread delete extensions and frees all resources
+ * associated with the thread. Afterwards the thread object is closed.
+ *
+ * @param[in, out] information is the thread information.
+ *
+ * @param[in, out] the_thread is the thread to free.
+ */
+void _Thread_Free(
+ Thread_Information *information,
+ Thread_Control *the_thread
+);
+
+/**
* @brief Starts the specified thread.
*
* If the thread is not in the dormant state, the routine returns with a value