MBX_create
Application Program Interface
2-197
C Interface
Syntax
mbx = MBX_create(msgsize, mbxlength, attrs);
Parameters
size_t
msgsize; /* size of message */
Uns
mbxlength;/* length of mailbox */
MBX_Attrs
*attrs;
/* pointer to mailbox attributes */
Return Value
MBX_Handle mbx;
/* mailbox object handle */
Description
MBX_create creates a mailbox object which is initialized to contain up to
mbxlength messages of size msgsize. If successful, MBX_create returns
the handle of the new mailbox object. If unsuccessful, MBX_create
returns NULL unless it aborts (for example, because it directly or
indirectly calls SYS_error, and SYS_error causes an abort).
If attrs is NULL, the new mailbox is assigned a default set of attributes.
Otherwise, the mailbox’s attributes are specified through a structure of
type MBX_Attrs.
All default attribute values are contained in the constant MBX_ATTRS,
which can be assigned to a variable of type MBX_Attrs prior to calling
MBX_create.
MBX_create calls MEM_alloc to dynamically create the object’s data
structure. MEM_alloc must acquire a lock to the memory before
proceeding. If another thread already holds a lock to the memory, then
there is a context switch. The segment from which the object is allocated
is described by the DSP/BIOS objects property in the MEM Module, page
2–205.
Constraints and
Calling Context
❏
MBX_create cannot be called from a SWI or HWI.
❏
You can reduce the size of your application program by creating
objects with Tconf rather than using the XXX_create functions.
See Also
MBX_create
Create a mailbox