The ReaderWriterMutex Concept extends the Mutex Concept to include the notion of reader-writer locks. It introduces a Boolean parameter, write
, that specifies whether a writer lock (write = true
) or reader lock (write = false
) is being requested. Multiple reader locks can be held simultaneously on a ReaderWriterMutex
if it does not have a writer lock on it. A writer lock on a ReaderWriterMutex
excludes all other tasks from holding a lock on the mutex at the same time.
Table 7-3 shows the requirements for ReaderWriterMutexRW
.
Table 7-3. ReaderWriterMutex Concept
Pseudosignature |
Semantics |
---|---|
|
Construct an unlocked mutex. |
|
Destroy an unlocked mutex. |
|
Acquire lock on mutex. |
|
Release lock. |
|
Change reader lock to writer lock. |
|
Change writer lock to reader lock. |
3.138.175.180