#include "ut/ut.h"
#include "lib/thread.h"
#include "lib/rwlock.h"
#include "lib/assert.h"
#include "lib/semaphore.h"
Go to the source code of this file.
|
enum | { NR = 255,
S = 8,
C = 3
} |
|
◆ anonymous enum
◆ M0_BASSERT()
◆ rcheck()
static void rcheck |
( |
int |
x | ) |
|
|
static |
◆ reader()
static void reader |
( |
int |
n | ) |
|
|
static |
◆ rstarver()
static void rstarver |
( |
int |
x | ) |
|
|
static |
◆ test_rw()
◆ test_rw_excl()
static void test_rw_excl |
( |
void |
| ) |
|
|
static |
Unit test: test that readers exclude writers.
Definition at line 164 of file rwlock.c.
◆ test_rw_readers()
static void test_rw_readers |
( |
void |
| ) |
|
|
static |
Unit test: test that multiple readers are allowed.
Definition at line 139 of file rwlock.c.
◆ test_rw_rstarve()
static void test_rw_rstarve |
( |
void |
| ) |
|
|
static |
Unit test: readers are not starved.
- Note
- Careful: rwlocks are not, in fact, fair. If S is increased, the starvation tests might become too slow.
Definition at line 200 of file rwlock.c.
◆ test_rw_writers()
static void test_rw_writers |
( |
void |
| ) |
|
|
static |
Unit test: mutual exclusion of writers is provided.
Definition at line 115 of file rwlock.c.
◆ test_rw_wstarve()
static void test_rw_wstarve |
( |
void |
| ) |
|
|
static |
Unit test: writers are not starved.
Definition at line 234 of file rwlock.c.
◆ wcheck()
static void wcheck |
( |
int |
x | ) |
|
|
static |
◆ writer()
static void writer |
( |
int |
n | ) |
|
|
static |
◆ wstarver()
static void wstarver |
( |
int |
x | ) |
|
|
static |
◆ counter
◆ stop
◆ sum