25 : reader_count_(0), writer_count_(0), room_empty_(1) {}
38 if (++reader_count_ == 1)
44 if (--reader_count_ == 0)
bool Post()
Wakes a single thread that is Wait()ing, or the next thread to call Wait().
bool Wait()
Blocks the calling thread until another thread calls Post().
void UnlockForRead()
Unlocks the ReadWriteLock for reading, which will allow writers to obtain a lock once the last reader...
void LockForWrite()
Locks the ReadWriteLock for writing.
void Unlock()
Unlocks the Mutex.
void UnlockForWrite()
Unlocks the ReadWriteLock for writing.
void Lock()
Locks the Mutex.
ReadWriteLock()
The semaphore is initialized to 1 so that the first Wait() succeeds.
void LockForRead()
Locks the ReadWriteLock for reading.