INtime SDK Help
knSendRtPriorityData
INtime SDK v7.1 > About INtime > INtime Kernel > Mailboxes > knSendRtPriorityData

Sends a high-priority data message to the given low-level mailbox and places it at the head of the queue. 

BOOLEAN knSendRtPriorityData(
    KNHANDLE hMailbox,   // handle for low-level mailbox
    LPVOID lpData,       // pointer to data message
    DWORD cbBytesSent       // number of bytes in message
);

Parameters

hMailbox
Handle for low-level mailbox, previously created with knCreateRtMailbox.
lpData
Pointer to the area containing the message to be sent.
cbBytesSent
Number of bytes in the message to be sent. The value can be no greater than the maximum message size specified when the mailbox was created.

Remarks

If a task is waiting at the mailbox, it receives the message; otherwise, the message is queued. If the mailbox is full, then an error is returned.

Mailboxes normally store messages in a FIFO queue. A series of knSendRtPriorityData calls results in messages queued in LIFO order.

When you create a low-level mailbox with knCreateRtMailbox, you can specify one of the slots in its queue as reserved for a high-priority message. knSendRtPriorityData can then use that slot.

Note:   If you use this call from an interrupt handler, use knStopRtScheduler before making the call.

Return Values

TRUE
Success
FALSE
To determine the status, call GetLastRtError

Status

E_OK
The mailbox accepted the message.
E_KN_LIMIT_EXCEEDED
The message was rejected because the mailbox was full.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib

See Also

Mailbox system calls, knCreateRtMailbox, knStopRtScheduler