#include <revolution/os.h>
BOOL OSReceiveMessage( OSMessageQueue* mq, OSMessage* msg, s32 flags);
|
Pointer to message queue. |
msg |
Pointer to the message being received. |
flags |
If OS_MESSAGE_BLOCK is set, the OSReceiveMessage function blocks empty queues. If OS_MESSAGE_NOBLOCK is set, the OSJamMessage function immediately returns whether or not the queue is empty. |
Returns TRUE if the message was retrieved without any problems.
Returns FALSE if OS_MESSAGE_NOBLOCK was specified and the queue is empty.
Extracts messages from the message queue. With this function, you can execute any waiting threads to send a message to the queue. The sending threads execute in order of priority.
If flags is set to OS_MESSAGE_BLOCK and the queue is empty, the thread that called this function will be paused. The thread resumes once the message is sent to the queue. Other receiving threads with a higher priority are executed first so be aware of when messages are removed. If the message queue is empty when this thread is executed, it will pause again until another message is sent to the queue.
If flags is set to OS_MESSAGE_NOBLOCK, the process immediately returns to the thread that was called. If the queue is not empty, TRUE is returned. If it is empty, FALSE is returned.
Thread Functions, Thread Synchronization Functions, OSInitMessageQueue, OSJamMessage, OSSendMessage
03/01/2006 Initial version.