diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-01-27 19:28:56 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-01 06:22:19 +0100 |
commit | bf8d4b94793eaf6e8ba1c694fcdb2885d75d61e3 (patch) | |
tree | 527838aa6c399ebd3e3e376af48068bf30f08bce /cpukit/rtems | |
parent | score: Rename _Thread_Get_objects_information() (diff) | |
download | rtems-bf8d4b94793eaf6e8ba1c694fcdb2885d75d61e3.tar.bz2 |
score: Add _Thread_Get_objects_information()
We do not need all the checks if we have a valid indentifier to a thread
class object.
Using the new _Thread_Get_objects_information() instead of the inline
function _Thread_Get_objects_information_by_id() avoids dead code since
the identifier in a thread control is always valid and the return NULL
path in _Thread_Get_objects_information_by_id() would be dead code. The
_Thread_Get_objects_information_by_id() should be an inline function
since it is used by _Thread_Get() and thus performance critical. Static
analyzers which cannot derive that the identifier in a thread control is
always valid, may find a potential NULL pointer access (or otherwise
find dead code).
The identifier in an object control is always valid, see
_Objects_Initialize_information() and _Objects_Extend_information().
Move _RTEMS_tasks_Free() to the only source file which calls this
function.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r-- | cpukit/rtems/src/taskconstruct.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/rtems/src/taskconstruct.c b/cpukit/rtems/src/taskconstruct.c index 6ff83a0b9c..d33a850d88 100644 --- a/cpukit/rtems/src/taskconstruct.c +++ b/cpukit/rtems/src/taskconstruct.c @@ -79,6 +79,14 @@ rtems_status_code rtems_task_construct( return _RTEMS_tasks_Create( config, id, _RTEMS_tasks_Prepare_user_stack ); } +static void _RTEMS_tasks_Free( Thread_Control *the_thread ) +{ + Thread_Information *information; + + information = _Thread_Get_objects_information( the_thread ); + _Objects_Free( &information->Objects, &the_thread->Object ); +} + rtems_status_code _RTEMS_tasks_Create( const rtems_task_config *config, rtems_id *id, |