|
| << Previous | Next >> |
OS_EVENT *OSMboxDel (OS_EVENT *pevent, INT8U opt, INT8U *err);
Description
- This function deletes a mailbox and readies all tasks pending on the mailbox. Note that:
- This function must be used with care. Tasks that would normally expect the presence of the mailbox MUST check the return code of
OSMboxPend().OSMboxAccept()callers will not know that the intended mailbox has been deleted unless they checkpeventto see that it's a NULL pointer.- This call can potentially disable interrupts for a long time. The interrupt disable time is directly proportional to the number of tasks waiting on the mailbox.
- Because ALL tasks pending on the mailbox will be readied, you MUST be careful in applications where the mailbox is used for mutual exclusion because the resource(s) will no longer be guarded by the mailbox.
Parameters
- pevent
- Pointer to the event control block associated with the desired mailbox.
- opt
- May be one of the following delete options:
- err
- Pointer to an error code that can contain one of the following values:
OS_NO_ERR- Call was successful; mailbox was deletedOS_ERR_DEL_ISR- Attempt to delete mailbox from ISROS_ERR_INVALID_OPT- Invalid option was specifiedOS_ERR_TASK_WAITING- One or more tasks were waiting on the mailboxOS_ERR_EVENT_TYPE- No pointer passed to a mailboxOS_ERR_PEVENT_NULL- Ifpeventis a NULL pointer.Return Value
- != (void *)0
- Is a pointer to the event control clock (OS_EVENT) associated with the created mailbox
- == (void *)0
- If no event control blocks were available
Library
- OS_MBOX.C
| 020-0059 Rev. D | << Previous | Next >> | µC/OS-II |