Skip to content

Commit

Permalink
Adding note on SB undefined behavior with SB_PEND_FOREVER and CFE_SB_…
Browse files Browse the repository at this point in the history
…DeletePipe()

See discussion in nasa#1777
  • Loading branch information
jbohren-hbr authored Aug 11, 2021
1 parent cfadad6 commit 66f87d5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/core_api/fsw/inc/cfe_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ CFE_Status_t CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const c
** associated with the pipe. All subscriptions made for this pipe by
** calls to #CFE_SB_Subscribe will be automatically removed from the
** SB routing tables. Any messages in the pipe will be discarded.
**
** If this routine is called from one task while execution of another
** task is blocked by a call to CFE_SB_ReceiveBuffer() with TimeOut
** #CFE_SB_PEND_FOREVER, there is no guarantee that
** CFE_SB_ReceiveBuffer() will return.
**
** Applications should not call this routine for all of their
** SB pipes as part of their orderly shutdown process, as the
Expand Down Expand Up @@ -434,6 +439,10 @@ CFE_Status_t CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenc
** If the pipe is empty, this routine will block until either a new
** message comes in or the timeout value is reached.
**
** There is no guarantee that this routine will return if
** CFE_SB_DeletePipe() is called from another task while this routine
** is blocking with TimeOut #CFE_SB_PEND_FOREVER.
**
** \par Assumptions, External Events, and Notes:
** Note - If an error occurs in this API, the *BufPtr value may be NULL or
** random. Therefore, it is recommended that the return code be tested
Expand Down

0 comments on commit 66f87d5

Please sign in to comment.