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

Requests a message from a specific low-level mailbox. If a high-priority message is present, that is the message returned, otherwise the message at the head of the queue is returned. If no message is present, the calling thread is put to sleep for the number of system timer ticks specified.

BOOLEAN knWaitForRtData(
    KNHANDLE hMailbox,            
    LPVOID lpData,                
    LPDWORD lpcbBytesReceived,    
    DWORD dwKernelTicks           
);

Parameters

hMailbox
Handle for low-level kernel mailbox, previously created with knCreateRtMailbox.
lpData
Pointer to the area containing the message to be received. This area must be at least as big as the maximum message size defined when the mailbox was created.
lpcbBytesReceived
Pointer to a variable in which the kernel specifies the number of bytes received.
dwKernelTicks
Number of low-level clock intervals which the calling thread can wait for a message before returning. The size of this interval is configurable and its value may be obtained from the SYSINFO structure which is read using CopyRtSystemInfo. The US_TO_KTICKS macro may be used to convert a value in microseconds to a system tick count using the information supplied in this structure.

Return Values

TRUE
Success
FALSE
To determine the status, call GetLastRtError

Status

E_OK
The thread received a message.
E_KN_TIME_OUT
The time limit expired.
E_KN_NONEXIST
The mailbox was deleted while the thread was waiting.
Note:   
  • Delete mailboxes only after a thread begins to wait. This call cannot return control to the calling thread if its corresponding mailbox is already deleted.
  • This is a blocking call. Do not use it in an interrupt handler.

Requirements

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

System & Status