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