Rev 2022 | Rev 2050 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2022 | Rev 2028 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | #define READERS 50 |
38 | #define READERS 50 |
39 | #define WRITERS 50 |
39 | #define WRITERS 50 |
40 | 40 | ||
41 | static rwlock_t rwlock; |
41 | static rwlock_t rwlock; |
42 | 42 | ||
43 | void test_rwlock1(void) |
43 | char * test_rwlock1(void) |
44 | { |
44 | { |
45 | printf("Read/write locks test #1\n"); |
- | |
46 | - | ||
47 | rwlock_initialize(&rwlock); |
45 | rwlock_initialize(&rwlock); |
48 | 46 | ||
49 | rwlock_write_lock(&rwlock); |
47 | rwlock_write_lock(&rwlock); |
50 | rwlock_write_unlock(&rwlock); |
48 | rwlock_write_unlock(&rwlock); |
51 | 49 | ||
Line 71... | Line 69... | ||
71 | rwlock_write_lock(&rwlock); |
69 | rwlock_write_lock(&rwlock); |
72 | rwlock_write_unlock(&rwlock); |
70 | rwlock_write_unlock(&rwlock); |
73 | 71 | ||
74 | rwlock_read_lock(&rwlock); |
72 | rwlock_read_lock(&rwlock); |
75 | rwlock_read_unlock(&rwlock); |
73 | rwlock_read_unlock(&rwlock); |
76 | 74 | ||
77 | printf("Test passed.\n"); |
75 | return NULL; |
78 | } |
76 | } |