function lfds710_queue_umm_dequeue

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds710
    ├───inc
    │   └───liblfds710
    │           lfds710_queue_umm.h
    └───src
        └───lfds710_queue
                lfds710_queue_umm_dequeue.c

Opaque Structures

struct lfds710_queue_umm_element;
struct lfds710_queue_umm_state;

Prototype

int lfds710_queue_umm_dequeue( struct lfds710_queue_umm_state *qumms,
                               struct lfds710_queue_umm_element **qumme );

Parameters

struct lfds710_queue_umm_state *qumms

A pointer to an initialized struct lfds710_queue_umm_state.

struct lfds710_queue_umm_element **qumme

A pointer to a pointer to a struct lfds710_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 LFDS710_QUEUE_UMM_GET_KEY_FROM_ELEMENT and LFDS710_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