Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
Multiple Producer Single Consumer (MPSC) Lockfree Queue API. More...
Files | |
file | mpsc_lockfree.h |
A wait-free intrusive multi producer single consumer (MPSC) queue using a singly linked list. | |
Data Structures | |
struct | mpsc_node |
Queue member. More... | |
struct | mpsc |
MPSC Queue. More... | |
Macros | |
#define | mpsc_ptr_get(ptr) atomic_ptr_get(&(ptr)) |
#define | mpsc_ptr_set(ptr, val) atomic_ptr_set(&(ptr), val) |
#define | mpsc_ptr_set_get(ptr, val) atomic_ptr_set(&(ptr), val) |
#define | MPSC_INIT(symbol) |
Static initializer for a mpsc queue. | |
Typedefs | |
typedef atomic_ptr_t | mpsc_ptr_t |
Functions | |
static void | mpsc_init (struct mpsc *q) |
Initialize queue. | |
static ALWAYS_INLINE void | mpsc_push (struct mpsc *q, struct mpsc_node *n) |
Push a node. | |
static struct mpsc_node * | mpsc_pop (struct mpsc *q) |
Pop a node off of the list. | |
Multiple Producer Single Consumer (MPSC) Lockfree Queue API.
#define MPSC_INIT | ( | symbol | ) |
#include <zephyr/sys/mpsc_lockfree.h>
Static initializer for a mpsc queue.
Since the queue is
symbol | name of the queue |
#define mpsc_ptr_get | ( | ptr | ) | atomic_ptr_get(&(ptr)) |
#include <zephyr/sys/mpsc_lockfree.h>
#define mpsc_ptr_set | ( | ptr, | |
val | |||
) | atomic_ptr_set(&(ptr), val) |
#include <zephyr/sys/mpsc_lockfree.h>
#define mpsc_ptr_set_get | ( | ptr, | |
val | |||
) | atomic_ptr_set(&(ptr), val) |
#include <zephyr/sys/mpsc_lockfree.h>
typedef atomic_ptr_t mpsc_ptr_t |
#include <zephyr/sys/mpsc_lockfree.h>
|
inlinestatic |
#include <zephyr/sys/mpsc_lockfree.h>
Pop a node off of the list.
NULL | When no node is available |
node | When node is available |
|
static |
#include <zephyr/sys/mpsc_lockfree.h>
Push a node.
q | Queue to push the node to |
n | Node to push into the queue |