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

A WriteLock obtains a write lock, but has a similar interface to a Mutex and can be used with a WriteGuard. More...

#include "readwritelock.h"

Public Member Functions

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

Detailed Description

A WriteLock obtains a write lock, but has a similar interface to a Mutex and can be used with a WriteGuard.

Definition at line 111 of file readwritelock.h.

Constructor & Destructor Documentation

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

The passed pointer must be non-NULL.

Definition at line 114 of file readwritelock.h.

ion::base::WriteLock::~WriteLock ( )
inline

Definition at line 115 of file readwritelock.h.

Member Function Documentation

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

Returns whether there are any writers in the lock.

This is similar to what it means for a Mutex to be locked.

Definition at line 124 of file readwritelock.h.

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

"Locks" the lock for writing, which blocks if there are any readers or writers holding the lock.

See the comments for ReadWriteLock.

Definition at line 118 of file readwritelock.h.

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

"Unlocks" the lock for writing, which may allow other readers or writers to proceed.

See the comments for ReadWriteLock.

Definition at line 121 of file readwritelock.h.


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