#include <revolution/os.h>
BOOL OSJamMessage( OSMessageQueue* mq, OSMessage msg, s32 flags);
|
Pointer to message queue. |
|
Message to send. |
|
If set to OS_MESSAGE_BLOCK, the OSJamMessage function blocks on a full queue. If set to OS_MESSAGE_NOBLOCK, the OSJamMessage function returns immediately whether or not the queue is full. |
Returns TRUE if the message is successfully sent.
Returns FALSE if OS_MESSAGE_NOBLOCK was specified and the queue is full.
The OSJamMessage and the OSSendMessage functions are similar except that the OSJamMessage inserts a message at the beginning of the specified message queue. Call this function when sending high priority messages.
If flags is set to OS_MESSAGE_BLOCK and the queue is full, the thread that called this function is paused. You can restart this thread by running a receiving thread and removing messages from the queue. Be aware that sending threads with a higher priority will execute first and may fill up the queue. In this case, this thread will be paused again until the receiving thread makes an opening in the message queue.
If flags is set to OS_MESSAGE_NOBLOCK, it returns to the calling thread immediately. When the queue isn't full, TRUE is returned. If the queue is full, FALSE is returned.
Thread Functions, Thread Synchronization Functions, OSInitMessageQueue, OSReceiveMessage, OSSendMessage
03/01/2006 Initial version.