fesa-core  7.0.0
fesa::ReadLock Class Reference

This class is used to automatically lock and unlock a read-write lock for reading. The constructor acquires a read-lock. The destructor releases the lock if it has not been explicitly unlocked. This ensures the read-write lock is returned to its previous state when a ReadLock object leaves scope. The read-write lock can also be unlocked explicitly, by calling the unlock() method. More...

#include <ReadLock.h>

Inherits noncopyable.

Public Member Functions

 ReadLock (RWLock &lock)
 Lock the associated read-write lock for reading if the current thread holds no locks. If this thread already holds a read lock or a write lock no action is required.
 
 ~ReadLock ()
 Unlocks the associated read-write lock if it has been acquired.
 
void unlock ()
 Unlocks the associated read-write lock if it has been acquired.
 

Detailed Description

This class is used to automatically lock and unlock a read-write lock for reading. The constructor acquires a read-lock. The destructor releases the lock if it has not been explicitly unlocked. This ensures the read-write lock is returned to its previous state when a ReadLock object leaves scope. The read-write lock can also be unlocked explicitly, by calling the unlock() method.


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