Rev 1 | Rev 430 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 410 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | RWLOCK_WRITER |
40 | RWLOCK_WRITER |
41 | }; |
41 | }; |
42 | 42 | ||
43 | struct rwlock { |
43 | struct rwlock { |
44 | spinlock_t lock; |
44 | spinlock_t lock; |
45 | mutex_t exclusive; |
45 | mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ |
46 | int readers_in; |
46 | int readers_in; /**< Number of readers in critical section. */ |
47 | }; |
47 | }; |
48 | 48 | ||
49 | #define rwlock_write_lock(rwl) \ |
49 | #define rwlock_write_lock(rwl) \ |
50 | _rwlock_write_lock_timeout((rwl),SYNCH_NO_TIMEOUT,SYNCH_BLOCKING) |
50 | _rwlock_write_lock_timeout((rwl),SYNCH_NO_TIMEOUT,SYNCH_BLOCKING) |
51 | #define rwlock_read_lock(rwl) \ |
51 | #define rwlock_read_lock(rwl) \ |