rwlock.c File Reference

Reader/Writer locks. More...

Include dependency graph for rwlock.c:

Go to the source code of this file.

Defines

#define ALLOW_ALL   0
#define ALLOW_READERS_ONLY   1

Functions

static void let_others_in (rwlock_t *rwl, int readers_only)
static void release_spinlock (void *arg)
void rwlock_initialize (rwlock_t *rwl)
int _rwlock_write_lock_timeout (rwlock_t *rwl, __u32 usec, int flags)
int _rwlock_read_lock_timeout (rwlock_t *rwl, __u32 usec, int flags)
void rwlock_write_unlock (rwlock_t *rwl)
void rwlock_read_unlock (rwlock_t *rwl)


Detailed Description

A reader/writer lock can be held by multiple readers at a time. Or it can be exclusively held by a sole writer at a time.

These locks are not recursive. Because technique called direct hand-off is used, neither readers nor writers will suffer starvation.

If there is a writer followed by a reader waiting for the rwlock and the writer times out, all leading readers are automatically woken up and allowed in.

Definition in file rwlock.c.


Generated on Sun Jun 18 17:30:24 2006 for HelenOS Kernel (ppc64) by  doxygen 1.4.6