macro LFDS711_LIST_ASU_GET_VALUE_FROM_ELEMENT

From liblfds.org
Revision as of 18:12, 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 File

└───liblfds711
    └───inc
        └───liblfds711
                lfds711_list_addonly_singlylinked_unordered.h

Opaque Structures

struct lfds711_list_asu_element;

Macro

#define LFDS711_LIST_ASU_GET_VALUE_FROM_ELEMENT( list_asu_element )

Parameters

list_asu_element

A struct lfds711_list_asu_element. Not a pointer to it - the struct itself.

Return Value

Returns a void pointer, the value from the element.

Notes

As with all liblfds macros, the macro operates on the structure itself, not a pointer to it.

The value in an element is set and set atomically by LFDS711_LIST_ASU_SET_VALUE_IN_ELEMENT and this get macro issues a load barrier before reading, which ensures that by the time LFDS711_LIST_ASU_SET_VALUE_IN_ELEMENT returns, the value set will be seen by all readers.

This contrasts to the bouded, single consumer, single producer queue, which only guarantees that the order of queuing will be honoured; it does not guarantee that by the time the enqueue function returns, readers will be able to dequeue the newly enqueued element.

Example

See Also