Read-Write Ticket Lock.
More...
Read-Write Ticket Lock.
|
| #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.
|
| |
◆ RWLOCK_DEADLOCK_ITERATIONS
| #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.
Definition at line 22 of file rwlock.h.
◆ RWLOCK_READ_SCOPE
| #define RWLOCK_READ_SCOPE |
( |
|
lock | ) |
|
Value:
rwlock_read_acquire((
lock))
#define CONCAT(a, b)
Concatenates two tokens.
static void rwlock_read_cleanup(rwlock_t **lock)
Read-Write Ticket Lock structure.
Acquires a rwlock for reading for the reminder of the current scope.
- Parameters
-
| lock | Pointer to the rwlock to acquire. |
Definition at line 29 of file rwlock.h.
◆ RWLOCK_WRITE_SCOPE
| #define RWLOCK_WRITE_SCOPE |
( |
|
lock | ) |
|
Value:
rwlock_write_acquire((
lock))
static void rwlock_write_cleanup(rwlock_t **lock)
Acquires a rwlock for writing for the reminder of the current scope.
- Parameters
-
| lock | Pointer to the rwlock to acquire. |
Definition at line 38 of file rwlock.h.
◆ RWLOCK_CREATE
| #define RWLOCK_CREATE |
( |
| ) |
|
Value:
{ \
}
#define ATOMIC_VAR_INIT(value)
Create a rwlock initializer.
- Returns
- A rwlock_t initializer.
Definition at line 47 of file rwlock.h.
◆ rwlock_init()
Initializes a rwlock.
- Parameters
-
| lock | Pointer to the rwlock to initialize. |
Definition at line 8 of file rwlock.c.
◆ rwlock_read_acquire()
| void rwlock_read_acquire |
( |
rwlock_t * |
lock | ) |
|
Acquires a rwlock for reading, blocking until it is available.
- Parameters
-
| lock | Pointer to the rwlock to acquire. |
Definition at line 18 of file rwlock.c.
◆ rwlock_read_release()
| void rwlock_read_release |
( |
rwlock_t * |
lock | ) |
|
Releases a rwlock from reading.
- Parameters
-
| lock | Pointer to the rwlock to release. |
Definition at line 54 of file rwlock.c.
◆ rwlock_write_acquire()
| void rwlock_write_acquire |
( |
rwlock_t * |
lock | ) |
|
Acquires a rwlock for writing, blocking until it is available.
- Parameters
-
| lock | Pointer to the rwlock to acquire. |
Definition at line 62 of file rwlock.c.
◆ rwlock_write_release()
| void rwlock_write_release |
( |
rwlock_t * |
lock | ) |
|
Releases a rwlock from writing.
- Parameters
-
| lock | Pointer to the rwlock to release. |
Definition at line 109 of file rwlock.c.
◆ rwlock_read_cleanup()
| static void rwlock_read_cleanup |
( |
rwlock_t ** |
lock | ) |
|
|
inlinestatic |
◆ rwlock_write_cleanup()
| static void rwlock_write_cleanup |
( |
rwlock_t ** |
lock | ) |
|
|
inlinestatic |