function lfds711_queue_umm_dequeue

From liblfds.org
Revision as of 18:11, 16 February 2017 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_queue_umm.h
    └───src
        └───lfds711_queue
                lfds711_queue_umm_dequeue.c

Opaque Structures

struct lfds711_queue_umm_element;
struct lfds711_queue_umm_state;

Prototype

int lfds711_queue_umm_dequeue( struct lfds711_queue_umm_state *qumms,
                               struct lfds711_queue_umm_element **qumme );

Parameters

struct lfds711_queue_umm_state *qumms

A pointer to an initialized struct lfds711_queue_umm_state.

struct lfds711_queue_umm_element **qumme

A pointer to a pointer to a struct lfds711_queue_umm_state, which is set to point to the dequeued element.

Return Value

Returns 1 on a successful dequeue. Returns 0 if dequeing failed. Dequeuing only fails if the queue is empty.

Notes

This function dequeues a queue element, with its key and value, from the queue. The key and value are read from the queue element by the macros LFDS711_QUEUE_UMM_GET_KEY_FROM_ELEMENT and LFDS711_QUEUE_UMM_GET_VALUE_FROM_ELEMENT respectively, and can only be correctly read when a queue element is outside of a queue; the macros can be issued at any time, of course, but if the element has not been dequeue by the thread calling the macro, then there is no guarantee the key and value read will be that which was written into the element. You were warned.

See Also