AWS SDK for C++  1.8.152
AWS SDK for C++
Public Member Functions | List of all members
Aws::Utils::Threading::ReaderWriterLock Class Reference

#include <ReaderWriterLock.h>

Public Member Functions

 ReaderWriterLock ()
 
void LockReader ()
 
void UnlockReader ()
 
void LockWriter ()
 
void UnlockWriter ()
 

Detailed Description

This lock is optimized for frequent reads and infrequent writes. However, writers get priority to the lock.

Definition at line 25 of file ReaderWriterLock.h.

Constructor & Destructor Documentation

◆ ReaderWriterLock()

Aws::Utils::Threading::ReaderWriterLock::ReaderWriterLock ( )

Member Function Documentation

◆ LockReader()

void Aws::Utils::Threading::ReaderWriterLock::LockReader ( )

Enters the lock in Reader-mode. This call blocks until no writers are acquiring the lock.

◆ LockWriter()

void Aws::Utils::Threading::ReaderWriterLock::LockWriter ( )

Enters the lock in Writer-mode. This call blocks until no readers nor writers are acquiring the lock.

◆ UnlockReader()

void Aws::Utils::Threading::ReaderWriterLock::UnlockReader ( )

Decrements the readers count by one and if the count is zero, signals any waiting writers to acquire the lock. NOTE: Calling this function without a matching LockReader results in undefined behavior.

◆ UnlockWriter()

void Aws::Utils::Threading::ReaderWriterLock::UnlockWriter ( )

Decrements the number of writers by one and signals any waiting readers or writers to acquire the lock. NOTE: Calling this function without a matching LockWriter results in undefined behavior.


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