PxMbxRelease()
Release a mailbox object.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxMbx_t PxMbxRelease (PxMbx_t Mbx); - ARGUMENTS
|
- RETURN VALUES
-
-
Invalid mailbox handle on success
-
Mailbox on failure
-
- ERROR CODES
-
PXERR_MBX_ILLMBXMbxis not a valid mailbox objectPXERR_MBX_PRIVMBXDELETEMailbox delete failed: private mailbox
PXERR_MBX_LEFTMESSAGESMailbox delete failed: messages left in the mailbox
PXERR_MBX_TASKWAITSMailbox delete failed: task(s) waiting at the mailbox
PXERR_OPOOL_ILLOPOOLThe object pool is not valid
PXERR_GLOBAL_ILLEGAL_COREThe requested object pool is not on the same core
PXERR_TASK_ILLTASKThe task is not a valid task object
- DESCRIPTION
-
PxMbxReleasereleases the mailbox handleMbxby converting it into a generic object and releasing this object.
- IMPLEMENTATION GUIDELINES
-
- Before call
-
-
Mbxmust be a valid PXROS-HR mailbox object created with aPxMbxRequestcall (V). The validity ofMbxmay also be checked by thePxMbxIsValidmacro (F).
-
- After call
-
-
PxMbxReleasereturns the mailbox object to the object pool it has been taken from. On successPxMbxReleasereturns the invalidated mailbox object. This may be checked with one of the following macros:-
PxMbxIsValid()must be false. -
PxMbxGet()must be_PXIllegalObjId. -
PxMbxError()must bePXERR_NOERRORotherwise the returned error code has to be interpreted (C).
-
-
- Best Practice
-
-
After
PxMbxRelease, the given mailbox objectMbxis no longer valid and may never be used as mailbox object!
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMbx_t Mbx = PxMbxRelease(Mbx); if (PxMbxIdError(Mbx) == PXERR_NOERROR) { // Report error }