From 8da9a42c7f2992c779f9c086d48db7f9ee52fd27 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 3 Jun 2021 19:57:18 +0000 Subject: [PATCH] Fix #741, Document CFE_TBL_Unregister use-case --- modules/core_api/fsw/inc/cfe_tbl.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_tbl.h b/modules/core_api/fsw/inc/cfe_tbl.h index b9938b370..fd9315920 100644 --- a/modules/core_api/fsw/inc/cfe_tbl.h +++ b/modules/core_api/fsw/inc/cfe_tbl.h @@ -230,11 +230,18 @@ CFE_Status_t CFE_TBL_Share(CFE_TBL_Handle_t *TblHandlePtr, const char *TblName); ** \brief Unregister a previously registered table and free associated resources ** ** \par Description -** When an application is being removed from the system, it should -** unregister those tables that it created. The application should -** call this function as a part of its cleanup process. The table -** will be removed from memory once all table addresses referencing -** it have been released. +** When an application is being removed from the system, ES will +** clean up/free all the application related resources including tables +** so apps are not required to call this function. +** +** Typically apps should only register tables during initialization and +** registration/unregistration during operation should be avoided. +** If those actions can not be avoided, special care needs to be taken +** (especially for shared tables) to avoid race conditions due to +** competing requests from mutiple tasks. +** +** Note the table will be removed from memory once all table access +** links have been removed (registration and all shared access). ** ** \par Assumptions, External Events, and Notes: ** None