A fair reader writer lock. More...
A fair reader writer lock.
The implementation ensures that readers and writers of the same priority won't starve each other. E.g. no new readers will get into the critical section if a writer of the same or a higher priority already waits for the lock.
Definition at line 36 of file pthread_rwlock.h.
#include <pthread_rwlock.h>
Data Fields | |
| int | readers | 
| The current amount of reader inside the critical section.  More... | |
| priority_queue_t | queue | 
| Queue of waiting threads.  | |
| mutex_t | mutex | 
| Provides mutual exclusion on reading and writing on the structure.  | |
| int pthread_rwlock_t::readers | 
The current amount of reader inside the critical section.
== 0: no thread is in the critical section.> 0: the number of readers currently in the critical section.< 0: a writer is currently in the critical section. Definition at line 45 of file pthread_rwlock.h.