#include <nitro/os.h>
BOOL OS_SendMessage(
OSMessageQueue* mq,
OSMessage msg,
s32 flag );
mq | Pointer to the message queue |
msg | Transmission message |
flag | When OS_MESSAGE_BLOCK is set, OS_SendMessage blocks when the queue is full. When OS_MESSAGE_NOBLOCK is set, OS_SendMessage returns whether the queue is full or not. |
TRUE
is returned when the message is successfully sent. FALSE
is returned when the queue is full and OS_MESSAGE_NOBLOCK
is specified.
This function inserts a message at the end of the specified message queue. The function makes it possible for threads waiting in the message queue to execute. The reception threads execute in order of priority.
If OS_MESSAGE_BLOCK
is set in flag
and the queue is full, the thread that called this function is temporarily stopped. It can be restarted by running a reception thread and removing a message from the queue. Be aware that if there are transmission threads of higher priority, they will execute first and may fill up the queue. In this case, this thread will again temporarily stop until an opening in the message queue is made by the reception thread.
When OS_MESSAGE_NOBLOCK
is set in flag
, the called thread is returned to immediately. When the queue is not full, TRUE
is returned. If the queue is full, FALSE
is returned.
OS_InitMessageQueue, OS_ReceiveMessage, OS_JamMessage
12/05/2003 Initial Version