macro LFDS711_LIST_ASO_GET_VALUE_FROM_ELEMENT

From liblfds.org
Jump to navigation Jump to search

Source File

└───liblfds711
    └───inc
        └───liblfds711
                lfds711_list_addonly_singlylinked_ordered.h

Opaque Structures

struct lfds711_list_aso_element;

Macro

#define LFDS711_LIST_ASO_GET_VALUE_FROM_ELEMENT( list_aso_element )

Parameters

list_aso_element

A struct lfds711_list_aso_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_ASO_SET_VALUE_IN_ELEMENT and this get macro issues a load barrier before reading, which ensures that by the time LFDS711_LIST_ASO_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

Coming soon. No, really! (Written 29th Dec 2015).

See Also