Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::ReadLock Class Reference

A ReadLock obtains a read lock, but has a similar interface to a Mutex and can be used with a ReadGuard. More...

#include "readwritelock.h"

Public Member Functions

 ReadLock (ReadWriteLock *lock)
 The passed pointer must be non-NULL. More...
 
 ~ReadLock ()
 
void Lock ()
 "Locks" the lock for reading, which may or may not block. More...
 
void Unlock ()
 "Unlocks" the lock for reading, which may allow other writers to proceed. More...
 
bool IsLocked () const
 Returns whether there are any readers in the lock. More...
 

Detailed Description

A ReadLock obtains a read lock, but has a similar interface to a Mutex and can be used with a ReadGuard.

Definition at line 86 of file readwritelock.h.

Constructor & Destructor Documentation

ion::base::ReadLock::ReadLock ( ReadWriteLock lock)
inlineexplicit

The passed pointer must be non-NULL.

Definition at line 89 of file readwritelock.h.

ion::base::ReadLock::~ReadLock ( )
inline

Definition at line 90 of file readwritelock.h.

Member Function Documentation

bool ion::base::ReadLock::IsLocked ( ) const
inline

Returns whether there are any readers in the lock.

This is not the same as what it means for a Mutex to be locked, but is a convenient way of determining whether any readers are currently active though a Mutex-like interface that LockGuards can understand.

Definition at line 101 of file readwritelock.h.

void ion::base::ReadLock::Lock ( )
inline

"Locks" the lock for reading, which may or may not block.

See the comments for ReadWriteLock.

Definition at line 93 of file readwritelock.h.

void ion::base::ReadLock::Unlock ( )
inline

"Unlocks" the lock for reading, which may allow other writers to proceed.

See the comments for ReadWriteLock.

Definition at line 96 of file readwritelock.h.


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