CreateUniqueMsgPort

Creates a message port with a unique name.

Synopsis

Item CreateUniqueMsgPort( 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.

This function works much like CreateMsgPort(), except that it guarantees that no other message port item of the same name already exists. And once this port created, no other port of the same name will be allowed to be created.

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 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. If a port of the same name already existed when this call was made, the ER_Kr_UniqueItemExists error will be returned.

Implementation

Convenience call implemented in clib.lib V24.

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.

See Also

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