|
| << Previous | Next >> |
OS_EVENT *OSQDel (OS_EVENT *pevent, INT8U opt, INT8U *err);
Description
- Deletes a message queue and readies all tasks pending on the queue. Note that:
- This function must be used with care. Tasks that would normally expect the presence of the queue MUST check the return code of
OSQPend().OSQAccept()callers will not know that the intended queue has been deleted unless they checkpeventto see that it's aNULLpointer.- 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 queue.
- Because all tasks pending on the queue will be readied, you must be careful in applications where the queue is used for mutual exclusion because the resource(s) will no longer be guarded by the queue.
- If the storage for the message queue was allocated dynamically (i.e. using a
malloc()type call) then your application must release the memory storage by call the counterpart call of the dynamic allocation scheme used. If the queue storage was created statically then, the storage can be reused.Parameters
- pevent
- Pointer to the queue's event control block.
- opt
- May be one of the following delete options:
- err
- Pointer to an error code that can contain one of the following :
OS_NO_ERR- The call was successful and thequeue was deleted
OS_ERR_DEL_ISR- You tried to delete the queuefrom an ISR
OS_ERR_INVALID_OPT- An invalid option was specified
OS_ERR_TASK_WAITING- One or more tasks were waiting on the queue
OS_ERR_EVENT_TYPE- If you didn't pass a pointer to a queue
OS_ERR_PEVENT_NULL- Ifpeventis aNULLpointer.
Return value
- pevent
- Error
- (OS_EVENT *)0
- The queue was successfully deleted.
Library
- OS_Q.C
| 020-0059 Rev. D | << Previous | Next >> | µC/OS-II |