CreateMsgPort

Creates a message port.

Synopsis

Item CreateMsgPort( const char *name, uint8 pri, uint32 signal )

Description

This convenience procedure creates a message port item. It also creates a message queue for the port in system RAM. You can use this procedure in place of CreateItem() to create the item.

Arguments

name
The name of the message port (see "Notes").
pri
The priority of the message port. The priority has no effect on the way message ports operate, but it does determine the order of the message ports in the global list of message ports and thus, the order in which a message ports are found.
signal
Specifies the bit in the signal word that is set when a message arrives at this port. If zero is supplied a new signal will be allocated. (See the description of AllocSignal() for information about allocating signal bits.)

Return Value

The procedure returns the item number of the new message port or an error code if an error occurs.

Implementation

Convenience call implemented in clib.lib V20.

Associated Files

msgport.h
ANSI C Prototype
clib.lib
ARM Link Library

Notes

When you no longer need a message port use DeleteMsgPort() to delete it.

You can use FindMsgPort() to find a message port by name. When creating message ports you should assign unique names whenever possible.

See Also

CreateMsg(), DeleteMsg(), DeleteMsgPort(), SendMsg(), SendSmallMsg()