OpendTect-6_4  6.4
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
Threads::Locker Class Reference

Locks the lock, shutting out access from other threads if needed. More...

Public Types

enum  WaitType { WaitIfLocked, DontWaitForLock }
 
enum  RWType { ReadLock, WriteLock }
 

Public Member Functions

 Locker (Lock &)
 
 Locker (Lock &, WaitType)
 
 Locker (Lock &, RWType)
 
 Locker (Lock &, WaitType, RWType)
 
 Locker (Lock &, RWType, WaitType)
 
virtual ~Locker ()
 
bool isLocked () const
 
void unlockNow ()
 
void reLock (WaitType wt=WaitIfLocked)
 < Locker goes out of scope More...
 
bool convertToWriteLock ()
 

Protected Attributes

Locklock_
 
bool needunlock_
 
bool isread_
 

Private Member Functions

 Locker (const Locker &)
 intentionally not implemented More...
 
Lockeroperator= (const Locker &)
 intentionally not implemented More...
 

Detailed Description

Locks the lock, shutting out access from other threads if needed.

Member Enumeration Documentation

Enumerator
ReadLock 
WriteLock 
Enumerator
WaitIfLocked 
DontWaitForLock 

Constructor & Destructor Documentation

Threads::Locker::Locker ( Lock )
Threads::Locker::Locker ( Lock ,
WaitType   
)
Threads::Locker::Locker ( Lock ,
RWType   
)
Threads::Locker::Locker ( Lock ,
WaitType  ,
RWType   
)
Threads::Locker::Locker ( Lock ,
RWType  ,
WaitType   
)
virtual Threads::Locker::~Locker ( )
inlinevirtual
Threads::Locker::Locker ( const Locker )
private

intentionally not implemented

Member Function Documentation

bool Threads::Locker::convertToWriteLock ( )
bool Threads::Locker::isLocked ( ) const
inline
Locker& Threads::Locker::operator= ( const Locker )
private

intentionally not implemented

void Threads::Locker::reLock ( WaitType  wt = WaitIfLocked)

< Locker goes out of scope

void Threads::Locker::unlockNow ( )

Member Data Documentation

bool Threads::Locker::isread_
protected
Lock& Threads::Locker::lock_
protected
bool Threads::Locker::needunlock_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019