Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/synch/rwlock.h

    rd99c1d2 rda1bafb  
    4848
    4949typedef struct {
    50         SPINLOCK_DECLARE(lock);
     50        IRQ_SPINLOCK_DECLARE(lock);
     51       
    5152        /**
    5253         * Mutex for writers, readers can bypass it if readers_in is positive.
     54         *
    5355         */
    5456        mutex_t exclusive;
     57       
    5558        /** Number of readers in critical section. */
    5659        size_t readers_in;
     
    5962#define rwlock_write_lock(rwl) \
    6063        _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
     64
    6165#define rwlock_read_lock(rwl) \
    6266        _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
     67
    6368#define rwlock_write_trylock(rwl) \
    6469        _rwlock_write_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \
    6570            SYNCH_FLAGS_NON_BLOCKING)
     71
    6672#define rwlock_read_trylock(rwl) \
    6773        _rwlock_read_lock_timeout((rwl), SYNCH_NO_TIMEOUT, \
    6874            SYNCH_FLAGS_NON_BLOCKING)
     75
    6976#define rwlock_write_lock_timeout(rwl, usec) \
    7077        _rwlock_write_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE)
     78
    7179#define rwlock_read_lock_timeout(rwl, usec) \
    7280        _rwlock_read_lock_timeout((rwl), (usec), SYNCH_FLAGS_NONE)
    7381
    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);
     82extern void rwlock_initialize(rwlock_t *);
     83extern void rwlock_read_unlock(rwlock_t *);
     84extern void rwlock_write_unlock(rwlock_t *);
     85extern int _rwlock_read_lock_timeout(rwlock_t *, uint32_t, unsigned int);
     86extern int _rwlock_write_lock_timeout(rwlock_t *, uint32_t, unsigned int);
    7987
    8088#endif
Note: See TracChangeset for help on using the changeset viewer.