Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages

kStatus kMsgQueue_Add | ( | kMsgQueue | queue,
|  | void * | item
| ) |  |

Adds an item to the queue.

If queue capacity is exceeded, the oldest non-critical item in the queue will be dropped to accomodate the new item. If a drop handler is installed, the handler will be called. If no drop handler is installed and the queue is an object container, then kObject_Dispose will be called to dispose the dropped item.

If the operation status returned by this function indicates an error, it is the responsibility of the caller to dispose the item (if appropriate). Because items can be automatically dropped (and this is not considered an error), failure is unlikely unless the underlying memory allocator is exhausted.

This method is thread-safe.

Parameters

  queue | Queue object.
  item | Item to be added.

Returns
  Operation status.