PxMsgRelease()
Release a message object (task service).
- APPLIES TO
-
8.2.0
- SYNOPSIS
-
PxMsg_t PxMsgRelease (PxMsg_t Msg); - ARGUMENTS
|
- RETURN VALUES
-
-
Invalid message handle on success
-
Msgon failure
-
- ERROR CODES
-
PXERR_MSG_ILLMSGThe passed message handle is invalid
PXERR_MSG_ILLUSERThe calling task is not the user of the message
PXERR_PROT_ILL_HANDLEThe associated protection handle is not valid
PXERR_REQUEST_INVALID_PARAMETERRequest with invalid parameter
PXERR_MBX_ILLMBXThe passed mailbox handle is invalid
PXERR_MSG_ILLOWNERThe message has no owner
PXERR_MC_ILLMCThe memory class for the message is invalid
PXERR_OPOOL_ILLOPOOLThe passed object pool handle is invalid
PXERR_INIT_ILLMCTYPEThe type for
PXMcSystemdefaultis different fromPXMcVarsized,PXMcVarsizedAdjustedandPXMcVarsizedAlignedPXERR_MC_DAMAGED_BLOCKThe block in memory class has been damaged
PXERR_MC_INCONSISTENCYInconsistency in memory class:
blkPXERR_MC_ILLALIGNInvalid memory block or size alignment in memory insert
PXERR_MC_ILLSIZEInsufficient block size
PXERR_GLOBAL_ILLEGAL_COREThe requested object pool is not on the same core
PXERR_TASK_ILLTASKThe task is not a valid task object
PXERR_INTERNAL_INCONSISTENCYInconsistency of internal structures
- DESCRIPTION
-
The
PxMsgReleasefunction releases the message specified inMsg. All necessary cleanup operations are performed. For envelope messages the release service checks if a task is waiting for the message being released. If so, the task is readied.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
Msgmust be a valid message object, requested viaPxMsgRequest…orPxMsgEnvelop…or received by aPxMsgReceive…call (V). This id may be checked with one of the following macros:-
PxMsgIdIsValid()must be true. -
PxMsgIdGet()must not be_PXIllegalObjId. -
PxMsgIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- After call
-
-
PxMsgReleasereturns the message object to the object pool it has been taken from. On successPxMsgReleasereturns the invalidated message object. This may be checked with one of the following macros:-
PxMsgIdIsValid()must be false. -
PxMsgIdGet()must be_PXIllegalObjId. -
PxMsgIdError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
After
PxMsgRelease, the given message objectMsgis no longer valid and may never be used as message object!
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMsg_t Msg = PxMsgRelease(Msg); if (PxMsgIdIsValid(Msg)) { // Report error }