Get next message from message port
Source position: exec.pas line 1273
function GetMsg( |
Port: PMsgPort |
):PMessage; |
Port |
|
Message port to check for new message |
A pointer to the first message available. If there are no messages, nil is returned.
This function receives a message from a given message port. It provides a fast, non-copying message receiving mechanism. The received message is removed from the message port.
This function will not wait. If a message is not present this function will return nil. If a program must wait for a message, it can Wait() on the signal specified for the port or use the WaitPort() function. There can only be one task waiting for any given port.
Getting a message does not imply to the sender that the message is free to be reused by the sender. When the receiver is finished with the message, it may ReplyMsg() it back to the sender.
Getting a signal does NOT always imply a message is ready. More than one message may arrive per signal, and signals may show up without messages. Typically you must loop to GetMsg() until it returns zero, then Wait() or WaitPort().
|
Put a message to a message port |
|
|
Put a message to its reply port |
|
|
Wait for a given port to be non-empty |
|
|
Wait for one or more signals |