Training
×

Data Mailbox System Calls

When information is sent to a data mailbox, it is copied from the specified buffer into the mailbox data queue. If one or more threads are already waiting for a message at the mailbox, the information is copied directly into the buffer specified by the sleeping thread at the head of the thread queue.
The thread that receives the data from the mailbox is notified of the number of bytes in the message by the return value (wReceived). The receive buffer must be at least 128 bytes in length, regardless of the number of bytes in the expected message.
The dwMilliseconds parameter specifies how long the receiving thread is willing to wait for a message to be delivered; these values can be specified:
  • NO_WAIT: the thread is not willing to wait. If no message is available, the thread receives an E_TIME exception code.
  • 1-655349: the number of milliseconds the thread wants to wait; the value is rounded to the next multiple of 10 msec. If no message is available within that time, the thread receives an E_TIME exception code.
  • WAIT_FOREVER: indicates that the thread will wait forever.