PxMsgAwaitRel()
Waits until a message is released.
- APPLIES TO
-
1.0.0
- SYNOPSIS
-
PxMsg_t PxMsgAwaitRel (PxMsg_t Msg); - ARGUMENTS
|
- RETURN VALUES
-
-
Msgon success -
Invalid message handle on failure
-
- ERROR CODES
-
PXERR_MSG_ABORTEDThe service was aborted by an event
PXERR_MSG_ILLMSGThe passed message handle is invalid
PXERR_MSG_ILLOWNERThe calling task is not the owner of the message
PXERR_MSG_NOT_IMPLEMENTEDThe message has not been set to wait for its release
- DESCRIPTION
-
The
PxMsgAwaitRelwaits for the messageMsgto be released. The messageMsgmust be created byPxMsgEnvelopor set toAwaitRelease. The calling task must be the owner of the message whose release is being awaited. The owner is always the task that created the message.
- 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).
-
-
The calling task must be the message’s creator (V), and if the message is created with
PxMsgRequest…, the message must be prepared by callingPxMsgSetToAwaitRel(V).
-
- After call
-
-
The return value of
PxMsgAwaitRelcontains the id of the original message. This may also be checked with the appropriate macros. If the message id is valid, the message may be released byPxMsgRelease.
-
- Best Practice
-
-
PxMsgAwaitRelmay block, if the message is never released. If blocking calls are prohibited,PxMsgAwaitRel_NoWaitshould be used instead.
-
- SEE ALSO
- USAGE
-
#include "pxdef.h" PxMsg_t RetMsg = PxMsgAwaitRel(Msg) if (PxMsgIdIsValid (RetMsg)) { // Handle message } else { // Report error }