43typedef struct rw_semaphore {
58#define RWSEM_INITIALIZER { 0, 0, NULL, NULL }
Definitions for builtin attributes and compiler directives.
#define __depr(m)
Mark something as deprecated, with an informative message.
Definition cdefs.h:119
int rwsem_write_lock(rw_semaphore_t *s)
Lock a reader/writer semaphore for writing.
int rwsem_read_trylock(rw_semaphore_t *s)
Attempt to lock a reader/writer semaphore for reading.
int rwsem_write_unlock(rw_semaphore_t *s)
Unlock a reader/writer semaphore from a write lock.
rw_semaphore_t * rwsem_create(void) __depr("Use rwsem_init or RWSEM_INITIALIZER.")
Allocate a reader/writer semaphore.
int rwsem_read_tryupgrade(rw_semaphore_t *s)
Attempt to upgrade a thread from reader status to writer status.
int rwsem_unlock(rw_semaphore_t *s)
Unlock a reader/writer semaphore.
int rwsem_destroy(rw_semaphore_t *s)
Destroy a reader/writer semaphore.
int rwsem_read_count(rw_semaphore_t *s)
Read the reader count on the reader/writer semaphore.
int rwsem_read_lock_irqsafe(rw_semaphore_t *s)
Lock a reader/writer semaphore for reading.
int rwsem_read_upgrade(rw_semaphore_t *s)
Upgrade a thread from reader status to writer status.
int rwsem_read_lock_timed(rw_semaphore_t *s, int timeout)
Lock a reader/writer semaphore for reading (with a timeout).
int rwsem_read_lock(rw_semaphore_t *s)
Lock a reader/writer semaphore for reading.
int rwsem_write_lock_irqsafe(rw_semaphore_t *s)
Lock a reader/writer semaphore for writing.
int rwsem_read_unlock(rw_semaphore_t *s)
Unlock a reader/writer semaphore from a read lock.
int rwsem_write_lock_timed(rw_semaphore_t *s, int timeout)
Lock a reader/writer semaphore for writing (with a timeout).
int rwsem_write_trylock(rw_semaphore_t *s)
Attempt to lock a reader/writer semaphore for writing.
int rwsem_init(rw_semaphore_t *s)
Initialize a reader/writer semaphore.
int rwsem_read_upgrade_timed(rw_semaphore_t *s, int timeout)
Upgrade a thread from reader status to writer status (with a timeout).
int rwsem_write_locked(rw_semaphore_t *s)
Read the state of the writer lock on the reader/writer semaphore.
Structure describing one running thread.
Definition thread.h:169
Reader/writer semaphore structure.
Definition rwsem.h:43
int read_count
The number of readers that are currently holding the lock.
Definition rwsem.h:48
kthread_t * write_lock
The thread holding the write lock.
Definition rwsem.h:51
kthread_t * reader_waiting
Space for one reader who's trying to upgrade to a writer.
Definition rwsem.h:54
int dynamic
Was this structure created with rwsem_create()?
Definition rwsem.h:45