MADNESS 0.10.1
madness::Spinlock Class Reference

Spinlock using pthread spinlock operations. More...

#include <worldmutex.h>

Inheritance diagram for madness::Spinlock:

Public Member Functions

 Spinlock (int junk=0)
 Make and initialize a spinlock ... initial state is unlocked.
virtual ~Spinlock ()
void lock () const
 Acquire the spinlock waiting if necessary.
bool try_lock () const
 Try to acquire the spinlock ... return true on success, false on failure.
void unlock () const
 Free a spinlock owned by this thread.

Private Member Functions

 Spinlock (const Spinlock &)
 Copy constructor is forbidden.
void operator= (const Spinlock &)
 Assignment is forbidden.

Private Attributes

pthread_spinlock_t spinlock

Detailed Description

Spinlock using pthread spinlock operations.

Constructor & Destructor Documentation

◆ Spinlock() [1/2]

madness::Spinlock::Spinlock ( const Spinlock & )
private

Copy constructor is forbidden.

References Spinlock().

Referenced by Spinlock(), madness::WorldProfileEntry::WorldProfileEntry(), and operator=().

◆ Spinlock() [2/2]

madness::Spinlock::Spinlock ( int junk = 0)
inline

Make and initialize a spinlock ... initial state is unlocked.

References spinlock.

◆ ~Spinlock()

virtual madness::Spinlock::~Spinlock ( )
inlinevirtual

References spinlock.

Member Function Documentation

◆ lock()

◆ operator=()

void madness::Spinlock::operator= ( const Spinlock & )
private

Assignment is forbidden.

References Spinlock().

◆ try_lock()

bool madness::Spinlock::try_lock ( ) const
inline

Try to acquire the spinlock ... return true on success, false on failure.

References spinlock.

Referenced by madness::MutexReaderWriter::lock().

◆ unlock()

Member Data Documentation

◆ spinlock

pthread_spinlock_t madness::Spinlock::spinlock
mutableprivate

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