PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
rwlock.h File Reference
#include <kernel/cpu/interrupt.h>
#include <kernel/defs.h>
#include <stdatomic.h>
Include dependency graph for rwlock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rwlock_t
 Read-Write Ticket Lock structure. More...
 

Macros

#define RWLOCK_DEADLOCK_ITERATIONS   10000000
 Number of iterations before we consider a deadlock to have occurred in a rwlock operation. This is only used in debug builds.
 
#define RWLOCK_READ_SCOPE(lock)
 Acquires a rwlock for reading for the reminder of the current scope.
 
#define RWLOCK_WRITE_SCOPE(lock)
 Acquires a rwlock for writing for the reminder of the current scope.
 
#define RWLOCK_CREATE()
 Create a rwlock initializer.
 

Typedefs

typedef struct thread thread_t
 

Functions

void rwlock_init (rwlock_t *lock)
 Initializes a rwlock.
 
void rwlock_read_acquire (rwlock_t *lock)
 Acquires a rwlock for reading, blocking until it is available.
 
void rwlock_read_release (rwlock_t *lock)
 Releases a rwlock from reading.
 
void rwlock_write_acquire (rwlock_t *lock)
 Acquires a rwlock for writing, blocking until it is available.
 
void rwlock_write_release (rwlock_t *lock)
 Releases a rwlock from writing.
 
static void rwlock_read_cleanup (rwlock_t **lock)
 
static void rwlock_write_cleanup (rwlock_t **lock)
 

Typedef Documentation

◆ thread_t

typedef struct thread thread_t

Definition at line 8 of file rwlock.h.