pthread_rwlock_t Struct Reference

A fair reader writer lock. More...

Detailed Description

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 37 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.
 

Field Documentation

int pthread_rwlock_t::readers
  • == 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 46 of file pthread_rwlock.h.


The documentation for this struct was generated from the following file: