macro LFDS700_QUEUE_GET_KEY_FROM_ELEMENT

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_queue.h

Opaque Structures

struct lfds700_queue_element;

Macro

#define LFDS700_QUEUE_GET_KEY_FROM_ELEMENT( queue_element )

Parameters

queue_element

A struct lfds700_queue_element. Not a pointer to it - the struct itfelf.

Return Value

Returns a void pointer, the key from the element.

Notes

The key set into a queue element is only guranteed to be visible to another logical core once the element has been dequeued by a thread running on that logical core.

So, for example, if there was a globally allocated queue element, where a thread on logical core A set a value and then enqueued the element to the queue, a thread on logical core B would only be guaranteed to see the key set by the other thread once it dequeues the element from the queue.

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

The key is not used in any way by the queue, and is provided for convenience when moving keys and values between different data structures.

Example

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

See Also