macro LFDS700_LIST_AOS_GET_VALUE_FROM_ELEMENT

From liblfds.org
Jump to navigation Jump to search

Source File

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_list_addonly_ordered_singlylinked.h

Opaque Structures

struct lfds700_list_aos_element;

Macro

#define LFDS700_LIST_AOS_GET_VALUE_FROM_ELEMENT( list_aos_element )

Parameters

list_aos_element

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