Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
spinlock.h File Reference

Public interface for spinlocks. More...

#include <errno.h>
#include <stdbool.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/time_units.h>

Go to the source code of this file.

Data Structures

struct  k_spinlock
 Kernel Spin Lock. More...
 

Macros

#define K_SPINLOCK_BREAK   continue
 Leaves a code block guarded with K_SPINLOCK after releasing the lock.
 
#define K_SPINLOCK(lck)
 Guards a code block with the given spinlock, automatically acquiring the lock before executing the code block.
 

Typedefs

typedef struct z_spinlock_key k_spinlock_key_t
 Spinlock key type.
 

Functions

static ALWAYS_INLINE k_spinlock_key_t k_spin_lock (struct k_spinlock *l)
 Lock a spinlock.
 
static ALWAYS_INLINE int k_spin_trylock (struct k_spinlock *l, k_spinlock_key_t *k)
 Attempt to lock a spinlock.
 
static ALWAYS_INLINE void k_spin_unlock (struct k_spinlock *l, k_spinlock_key_t key)
 Unlock a spin lock.
 

Detailed Description

Public interface for spinlocks.