function lfds711_queue_bss_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_bounded_singleproducer_singleconsumer.h
    └───src
        └───lfds711_queue_bounded_singleproducer_singleconsumer
                lfds711_queue_bounded_singleproducer_singleconsumer_dequeue.c

Opaque Structures

struct lfds711_queue_bss_state;

Prototype

void lfds711_queue_bss_dequeue( struct lfds711_queue_bss_state *qbsss, void **key, void **value );

Parameters

struct lfds711_queue_bss_state *qbsss

A pointer to an initialized struct lfds711_queue_bss_state.

void **key

A pointer to a void pointer, which is set to the key of the dequeued element. This argument can be NULL.

void **value

A pointer to a void pointer, which is set to the value of the dequeued element. This argument can be NULL.

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 an element from the queue.

Unlike all the other data structures in liblfds, there is with this queue no guarantee that enqueued elements are ever seen by the consumer thread. In practise, they are, and in a very short time - fifty microseconds or whatever it may be; but, unlike the other data structures, there is then on guarantee of visibility simply because the enqueue function has returned. As such dequeue may for a brief time return nothing, when in fact an element has been enqueued.

See Also