OpendTect  6.6
Public Member Functions | Protected Attributes | List of all members
Threads::ReadWriteLock Class Reference

Lock that permits multiple readers to lock the object at the same time, but it will not allow any readers when writelocked, and no writelock is allowed when readlocked. More...

Public Member Functions

 ReadWriteLock ()
 
 ReadWriteLock (const ReadWriteLock &)
 
virtual ~ReadWriteLock ()
 
void convPermissiveToWriteLock ()
 
bool convReadToWriteLock ()
 
void convWriteToPermissive ()
 
void convWriteToReadLock ()
 Lock MUST be writeLocked when calling. More...
 
void permissiveWriteLock ()
 
void permissiveWriteUnLock ()
 
void readLock ()
 No writers will be active. More...
 
void readUnLock ()
 
bool tryReadLock ()
 No writers will be active. More...
 
bool tryWriteLock ()
 No readers will be active. More...
 
void writeLock ()
 No readers will be active. More...
 
void writeUnLock ()
 

Protected Attributes

int nrreaders_
 
char status_
 
ConditionVar statuscond_
 

Detailed Description

Lock that permits multiple readers to lock the object at the same time, but it will not allow any readers when writelocked, and no writelock is allowed when readlocked.

<>

Constructor & Destructor Documentation

◆ ReadWriteLock() [1/2]

Threads::ReadWriteLock::ReadWriteLock ( )

◆ ReadWriteLock() [2/2]

Threads::ReadWriteLock::ReadWriteLock ( const ReadWriteLock )

◆ ~ReadWriteLock()

virtual Threads::ReadWriteLock::~ReadWriteLock ( )
virtual

Member Function Documentation

◆ convPermissiveToWriteLock()

void Threads::ReadWriteLock::convPermissiveToWriteLock ( )

◆ convReadToWriteLock()

bool Threads::ReadWriteLock::convReadToWriteLock ( )

Lock MUST be readLocked when calling. Object Will always be in write-lock status on return.

Returns
false if it had to release the readlock when switching to writelock.

◆ convWriteToPermissive()

void Threads::ReadWriteLock::convWriteToPermissive ( )

◆ convWriteToReadLock()

void Threads::ReadWriteLock::convWriteToReadLock ( )

Lock MUST be writeLocked when calling.

◆ permissiveWriteLock()

void Threads::ReadWriteLock::permissiveWriteLock ( )

Same as readlock, but I'm guaranteed to convert to writelock without giving up my lock. Only one thread may have the permissive write lock at any given time.

◆ permissiveWriteUnLock()

void Threads::ReadWriteLock::permissiveWriteUnLock ( )

◆ readLock()

void Threads::ReadWriteLock::readLock ( )

No writers will be active.

◆ readUnLock()

void Threads::ReadWriteLock::readUnLock ( )

◆ tryReadLock()

bool Threads::ReadWriteLock::tryReadLock ( )

No writers will be active.

◆ tryWriteLock()

bool Threads::ReadWriteLock::tryWriteLock ( )

No readers will be active.

◆ writeLock()

void Threads::ReadWriteLock::writeLock ( )

No readers will be active.

◆ writeUnLock()

void Threads::ReadWriteLock::writeUnLock ( )

Member Data Documentation

◆ nrreaders_

int Threads::ReadWriteLock::nrreaders_
protected

◆ status_

char Threads::ReadWriteLock::status_
protected

◆ statuscond_

ConditionVar Threads::ReadWriteLock::statuscond_
protected

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