Rev 1787 | Rev 2028 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1787 | Rev 2022 | ||
|---|---|---|---|
| Line 40... | Line 40... | ||
| 40 | static rwlock_t rwlock; |
40 | static rwlock_t rwlock; |
| 41 | 41 | ||
| 42 | static void writer(void *arg); |
42 | static void writer(void *arg); |
| 43 | static void failed(void); |
43 | static void failed(void); |
| 44 | 44 | ||
| 45 | void writer(void *arg) |
45 | static void writer(void *arg) |
| 46 | { |
46 | { |
| 47 | 47 | ||
| 48 | thread_detach(THREAD); |
48 | thread_detach(THREAD); |
| 49 | 49 | ||
| 50 | printf("Trying to lock rwlock for writing....\n"); |
50 | printf("Trying to lock rwlock for writing....\n"); |
| Line 56... | Line 56... | ||
| 56 | rwlock_read_lock(&rwlock); |
56 | rwlock_read_lock(&rwlock); |
| 57 | rwlock_read_unlock(&rwlock); |
57 | rwlock_read_unlock(&rwlock); |
| 58 | printf("Test passed.\n"); |
58 | printf("Test passed.\n"); |
| 59 | } |
59 | } |
| 60 | 60 | ||
| 61 | void failed() |
61 | static void failed() |
| 62 | { |
62 | { |
| 63 | printf("Test failed prematurely.\n"); |
63 | printf("Test failed prematurely.\n"); |
| 64 | thread_exit(); |
64 | thread_exit(); |
| 65 | } |
65 | } |
| 66 | 66 | ||
| 67 | void test(void) |
67 | void test_rwlock2(void) |
| 68 | { |
68 | { |
| 69 | thread_t *thrd; |
69 | thread_t *thrd; |
| 70 | 70 | ||
| 71 | printf("Read/write locks test #2\n"); |
71 | printf("Read/write locks test #2\n"); |
| 72 | 72 | ||