CNDP
22.08.0
|
#include <unistd.h>
#include <cne_cpuflags.h>
#include <cne_cycles.h>
#include <cne_branch_prediction.h>
#include <cne_common.h>
#include <cne_gettid.h>
#include <cne_system.h>
#include <cne_pause.h>
#include <cne_rtm.h>
Go to the source code of this file.
Data Structures | |
struct | cne_spinlock_t |
struct | cne_spinlock_recursive_t |
Macros | |
#define | CNE_SPINLOCK_INITIALIZER |
#define | CNE_SPINLOCK_RECURSIVE_INITIALIZER |
Functions | |
static void | cne_spinlock_init (cne_spinlock_t *sl) |
static int | cne_spinlock_is_locked (cne_spinlock_t *sl) |
static void | cne_spinlock_recursive_init (cne_spinlock_recursive_t *slr) |
static void | cne_spinlock_recursive_lock (cne_spinlock_recursive_t *slr) |
static void | cne_spinlock_recursive_unlock (cne_spinlock_recursive_t *slr) |
static int | cne_spinlock_recursive_trylock (cne_spinlock_recursive_t *slr) |
CNE Spinlocks
This file defines an API for read-write locks, which are implemented in an architecture-specific way. This kind of lock simply waits in a loop repeatedly checking until the lock becomes available.
All locks must be initialised before use, and only initialised once.
Definition in file cne_spinlock.h.
#define CNE_SPINLOCK_INITIALIZER |
#define CNE_SPINLOCK_RECURSIVE_INITIALIZER |
A static recursive spinlock initializer.
Definition at line 192 of file cne_spinlock.h.
|
inlinestatic |
Initialize the spinlock to an unlocked state.
sl | A pointer to the spinlock. |
Definition at line 62 of file cne_spinlock.h.
|
inlinestatic |
Test if the lock is taken.
sl | A pointer to the spinlock. |
Definition at line 175 of file cne_spinlock.h.
|
inlinestatic |
Initialize the recursive spinlock to an unlocked state.
slr | A pointer to the recursive spinlock. |
Definition at line 204 of file cne_spinlock.h.
|
inlinestatic |
Take the recursive spinlock.
slr | A pointer to the recursive spinlock. |
Definition at line 218 of file cne_spinlock.h.
|
inlinestatic |
Release the recursive spinlock.
slr | A pointer to the recursive spinlock. |
Definition at line 235 of file cne_spinlock.h.
|
inlinestatic |
Try to take the recursive lock.
slr | A pointer to the recursive spinlock. |
Definition at line 252 of file cne_spinlock.h.