A single writer, multiple reader mutex class.
Public Member Functions
Locks the mutex for shared read. Once acquired, the caller is guaranteed safe read-only access, with all would-be writers being blocked. Note that if the protected resource contains mutable data, simultaneous read access resulting in modification of that data is almost guaranteed to cause a crash.
Unlocks the mutex after shared read.
Locks the mutex for exclusive write. Once acquired, the caller is guaranteed exclusive access with neither readers nor writers holding the mutex. After calling LockWrite, all would-be readers or writers will be blocked until the caller has acquired and released the requested write access.
Unlocks the mutex after exclusive write.