Changes in kernel/generic/include/synch/rwlock.h [da1bafb:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/rwlock.h
rda1bafb rd99c1d2 48 48 49 49 typedef struct { 50 IRQ_SPINLOCK_DECLARE(lock); 51 50 SPINLOCK_DECLARE(lock); 52 51 /** 53 52 * Mutex for writers, readers can bypass it if readers_in is positive. 54 *55 53 */ 56 54 mutex_t exclusive; 57 58 55 /** Number of readers in critical section. */ 59 56 size_t readers_in; … … 62 59 #define rwlock_write_lock(rwl) \ 63 60 _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 64 65 61 #define rwlock_read_lock(rwl) \ 66 62 _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE) 67 68 63 #define rwlock_write_trylock(rwl) \ 69 64 _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \ 70 65 SYNCH_FLAGS_NON_BLOCKING) 71 72 66 #define rwlock_read_trylock(rwl) \ 73 67 _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \ 74 68 SYNCH_FLAGS_NON_BLOCKING) 75 76 69 #define rwlock_write_lock_timeout(rwl, usec) \ 77 70 _rwlock_write_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE) 78 79 71 #define rwlock_read_lock_timeout(rwl, usec) \ 80 72 _rwlock_read_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE) 81 73 82 extern void rwlock_initialize(rwlock_t * );83 extern void rwlock_read_unlock(rwlock_t * );84 extern void rwlock_write_unlock(rwlock_t * );85 extern int _rwlock_read_lock_timeout(rwlock_t * , uint32_t, unsigned int);86 extern int _rwlock_write_lock_timeout(rwlock_t * , uint32_t, unsigned int);74 extern void rwlock_initialize(rwlock_t *rwl); 75 extern void rwlock_read_unlock(rwlock_t *rwl); 76 extern void rwlock_write_unlock(rwlock_t *rwl); 77 extern int _rwlock_read_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); 78 extern int _rwlock_write_lock_timeout(rwlock_t *rwl, uint32_t usec, int flags); 87 79 88 80 #endif
Note:
See TracChangeset
for help on using the changeset viewer.