trcv_mbx
ER trcv_mbx (ID mbxid, T_MSG **ppk_msg, TMO tmout);
typedef struct t_msg_pri { struct t_msg msgque; /*Reserved for future use*/ PRI msgpri; /*Message priority*/ } T_MSG_PRI; |
This service call receives a message from the mailbox specified by parameter mbxid, and stores its start address in the area specified by parameter ppk_msg.
If no message could be received from the target mailbox (no messages were queued to the wait queue) when this service call is issued, this service call does not receive messages but queues the invoking task to the target mailbox wait queue and moves it from the RUNNING state to the WAITING state with timeout (message reception wait state).
The receiving WAITING state for a mailbox is cancelled in the following cases, and then moved to the READY state.
Note 1 Invoking tasks are queued to the target mailbox wait queue in the order defined during configuration (FIFO order or priority order).
Note 2 If the message reception wait state is cancelled because rel_wai or irel_wai was issued or the wait time elapsed, the contents in the area specified by parameter ppk_msg become undefined.
Note 3 TMO_FEVR is specified for wait time tmout, processing equivalent to rcv_mbx will be executed. When TMO_POL is specified, processing equivalent to prcv_mbx /iprcv_mbx will be executed.