Difference between pages "r7.1.1:Macro LFDS711 LIST ASU GET USER STATE FROM STATE" and "r7.1.1:Macro LFDS711 LIST ASU GET VALUE FROM ELEMENT"
(Difference between pages)
Jump to navigation
Jump to search
m (1 revision imported) |
m (1 revision imported) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:macro | {{DISPLAYTITLE:macro LFDS711_LIST_ASU_GET_VALUE_FROM_ELEMENT}} | ||
==Source File== | ==Source File== | ||
└───liblfds711 | └───liblfds711 | ||
Line 7: | Line 7: | ||
==Opaque Structures== | ==Opaque Structures== | ||
struct [[r7.1.1:struct | struct [[r7.1.1:struct lfds711_list_asu_element|lfds711_list_asu_element]]; | ||
==Macro== | ==Macro== | ||
#define | #define LFDS711_LIST_ASU_GET_VALUE_FROM_ELEMENT( list_asu_element ) | ||
==Parameters== | ==Parameters== | ||
'' | ''list_asu_element'' | ||
: | : A ''struct lfds711_list_asu_element''. Not a pointer to it - the struct itself. | ||
==Return Value== | ==Return Value== | ||
Returns a | Returns a void pointer, the value from the element. | ||
==Notes== | ==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== | ==Example== | ||
==See Also== | ==See Also== | ||
* [[r7.1.1:List (add-only, singly-linked, unordered)|List (add-only, singly-linked, unordered)]] | * [[r7.1.1:List (add-only, singly-linked, unordered)|List (add-only, singly-linked, unordered)]] |
Latest revision as of 18:12, 16 February 2017
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.