AutoRWLocker Class Reference

#include <c4d_thread.h>

Detailed Description

Much the same as AutoLocker but allows differentiation of read/write access.

See also
AutoLocker for examples.

Public Member Functions

 AutoRWLocker ()
 
 AutoRWLocker (AutoRWLock &lock, Bool write_lock=true)
 
 ~AutoRWLocker ()
 
void DoLock (AutoRWLock &lock, Bool write_lock=true)
 
void Unlock ()
 

Private Member Functions

AutoRWLockeroperator= (const AutoRWLocker &d)
 
 AutoRWLocker (AutoRWLocker &lock)
 

Private Attributes

maxon::RWSpinlockl
 
volatile UInt32ct
 
volatile Bool is_write
 

Constructor & Destructor Documentation

◆ AutoRWLocker() [1/3]

AutoRWLocker ( AutoRWLocker lock)
private

◆ AutoRWLocker() [2/3]

Default constructor.

◆ AutoRWLocker() [3/3]

AutoRWLocker ( AutoRWLock lock,
Bool  write_lock = true 
)
explicit

Locks the passed AutoRWLock.

Parameters
[in]lockThe AutoRWLock to lock.
[in]write_locktrue for write access, false for read access only.

◆ ~AutoRWLocker()

Destructor.

Member Function Documentation

◆ operator=()

AutoRWLocker& operator= ( const AutoRWLocker d)
private

◆ DoLock()

void DoLock ( AutoRWLock lock,
Bool  write_lock = true 
)

Locks the passed AutoRWLock.

Parameters
[in]lockThe AutoRWLock to lock.
[in]write_locktrue for write access, false for read access only.

◆ Unlock()

void Unlock ( )

Unlocks the locked AutoRWLock.

Member Data Documentation

◆ l

maxon::RWSpinlock* l
private

◆ ct

volatile UInt32* ct
private

◆ is_write

volatile Bool is_write
private