46,11 → 46,11 |
|
static rwlock_t rwlock; |
|
SPINLOCK_INITIALIZE(lock); |
static SPINLOCK_INITIALIZE(lock); |
|
static waitq_t can_start; |
|
uint32_t seed = 0xdeadbeef; |
static uint32_t seed = 0xdeadbeef; |
|
static uint32_t random(uint32_t max); |
|
58,7 → 58,7 |
static void reader(void *arg); |
static void failed(void); |
|
uint32_t random(uint32_t max) |
static uint32_t random(uint32_t max) |
{ |
uint32_t rc; |
|
70,7 → 70,7 |
} |
|
|
void writer(void *arg) |
static void writer(void *arg) |
{ |
int rc, to; |
thread_detach(THREAD); |
93,7 → 93,7 |
printf("cpu%d, tid %d w-\n", CPU->id, THREAD->tid); |
} |
|
void reader(void *arg) |
static void reader(void *arg) |
{ |
int rc, to; |
thread_detach(THREAD); |
112,13 → 112,13 |
printf("cpu%d, tid %d r-\n", CPU->id, THREAD->tid); |
} |
|
void failed(void) |
static void failed(void) |
{ |
printf("Test failed prematurely.\n"); |
thread_exit(); |
} |
|
void test(void) |
void test_rwlock4(void) |
{ |
context_t ctx; |
uint32_t i, k; |