P99
Related Functions

A simple rwlock implementation. More...

#include <p99_rwl.h>

Related Functions

(Note that these are not member functions.)

bool p99_rwl_haswaiters (p99_rwl volatile *p00_r)
 Tell if has waiters. More...
 
bool p99_rwl_islocked (p99_rwl volatile *p00_r)
 Tell if is locked. More...
 
int p99_rwl_rdlock (p99_rwl volatile *p00_r)
 establish a shared lock for rwlock p00_c. More...
 
int p99_rwl_unlock (p99_rwl volatile *p00_r)
 release a lock on rwlock p00_r. More...
 
int p99_rwl_wrlock (p99_rwl volatile *p00_r)
 establish an exclusive lock for rwlock p00_r. More...
 

Detailed Description

A simple rwlock implementation.

This is implemented more or less efficiently according to the features that the platform provides:

It has the following properties:

As a consequence, this form of lock can be easily cleaned up if a thread has left it locked and then walked away:

This takes care of all situations where no other thread actively is trying to achieve the lock.

Definition at line 66 of file p99_rwl.h.


The documentation for this struct was generated from the following file:
p99_rwl::p99_rwl_unlock
int p99_rwl_unlock(p99_rwl volatile *p00_r)
release a lock on rwlock p00_r.
Definition: p99_rwl.h:179
P99_RWL_INITIALIZER
#define P99_RWL_INITIALIZER
Initialize an p99_rwl object.
Definition: p99_rwl.h:84
p99_rwl::p99_rwl_islocked
bool p99_rwl_islocked(p99_rwl volatile *p00_r)
Tell if is locked.
Definition: p99_rwl.h:200
p99_rwl
A simple rwlock implementation.
Definition: p99_rwl.h:66