OpendTect  7.0
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  RWType { ReadLock , WriteLock }
 
enum  WaitType { WaitIfLocked , DontWaitForLock }
 

Public Member Functions

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

Protected Attributes

bool isread_
 
Locklock_
 
bool needunlock_
 

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

◆ RWType

Enumerator
ReadLock 
WriteLock 

◆ WaitType

Enumerator
WaitIfLocked 
DontWaitForLock 

Constructor & Destructor Documentation

◆ Locker() [1/6]

Threads::Locker::Locker ( Lock )

◆ Locker() [2/6]

Threads::Locker::Locker ( Lock ,
WaitType   
)

◆ Locker() [3/6]

Threads::Locker::Locker ( Lock ,
RWType   
)

◆ Locker() [4/6]

Threads::Locker::Locker ( Lock ,
WaitType  ,
RWType   
)

◆ Locker() [5/6]

Threads::Locker::Locker ( Lock ,
RWType  ,
WaitType   
)

◆ ~Locker()

virtual Threads::Locker::~Locker ( )
inlinevirtual

◆ Locker() [6/6]

Threads::Locker::Locker ( const Locker )
private

intentionally not implemented

Member Function Documentation

◆ convertToWriteLock()

bool Threads::Locker::convertToWriteLock ( )

◆ isLocked()

bool Threads::Locker::isLocked ( ) const
inline

◆ operator=()

Locker& Threads::Locker::operator= ( const Locker )
private

intentionally not implemented

◆ reLock()

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

< Locker goes out of scope

◆ unlockNow()

void Threads::Locker::unlockNow ( )

Member Data Documentation

◆ isread_

bool Threads::Locker::isread_
protected

◆ lock_

Lock& Threads::Locker::lock_
protected

◆ needunlock_

bool Threads::Locker::needunlock_
protected

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