| Reader/Writer lock with write priority.
If a reader holds the lock, all incoming readers are allowed to acquire the
lock until a write arrives. A writer must wait for all current readers to
release the lock before acquiring it.
When a writer has the lock, everybody else is blocked.
When a writer release the lock, there is a writer priority so if another
writer is waiting it will have the lock even if it arrived later than
readers. Writers are prioritary against readers but all writers get the lock
in a FIFO order.
author: Emmanuel Cecchet version: 1.0 |