PatchworkOS  3984a1d
A non-POSIX operating system.
Loading...
Searching...
No Matches
seqlock.h File Reference
#include <kernel/sync/lock.h>
#include <stdatomic.h>
Include dependency graph for seqlock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  seqlock_t
 Sequence lock structure. More...
 

Macros

#define SEQLOCK_CREATE()   {.sequence = ATOMIC_VAR_INIT(0), .writeLock = LOCK_CREATE()}
 Create a sequence lock initializer.
 
#define SEQLOCK_READ_SCOPE(seqlock)
 Read scope for a sequence lock.
 

Functions

static void seqlock_init (seqlock_t *seqlock)
 Initializes a sequence lock.
 
static void seqlock_write_acquire (seqlock_t *seqlock)
 Acquires the write lock of a sequence lock.
 
static void seqlock_write_release (seqlock_t *seqlock)
 Releases the write lock of a sequence lock.
 
static uint64_t seqlock_read_begin (seqlock_t *seqlock)
 Begins a read operation on a sequence lock.
 
static bool seqlock_read_retry (seqlock_t *seqlock, uint64_t seq)
 Checks if a read operation on a sequence lock needs to be retried.