Equalizer 1.0

co::base::SpinLock Class Reference

A fast lock for uncontended memory access. More...

#include <spinLock.h>

Inheritance diagram for co::base::SpinLock:
Collaboration diagram for co::base::SpinLock:

List of all members.

Public Member Functions

 SpinLock ()
 Construct a new lock.
 ~SpinLock ()
 Destruct the lock.
void set ()
 Acquire the lock.
void unset ()
 Release the lock.
bool trySet ()
 Attempt to acquire the lock.
bool isSet ()
 Test if the lock is set.

Detailed Description

A fast lock for uncontended memory access.

Be aware of possible priority inversion.

See also:
ScopedMutex

Definition at line 37 of file spinLock.h.


Constructor & Destructor Documentation

co::base::SpinLock::SpinLock ( ) [inline]

Construct a new lock.

Version:
1.0

Definition at line 41 of file spinLock.h.

co::base::SpinLock::~SpinLock ( ) [inline]

Destruct the lock.

Version:
1.0

Definition at line 44 of file spinLock.h.


Member Function Documentation

bool co::base::SpinLock::isSet ( ) [inline]

Test if the lock is set.

Returns:
true if the lock is set, false if it is not set.
Version:
1.0

Definition at line 86 of file spinLock.h.

void co::base::SpinLock::set ( ) [inline]

Acquire the lock.

Version:
1.0

Definition at line 47 of file spinLock.h.

bool co::base::SpinLock::trySet ( ) [inline]

Attempt to acquire the lock.

This method implements an atomic test-and-set operation.

Returns:
true if the lock was set, false if it was not set.
Version:
1.0

Definition at line 72 of file spinLock.h.

void co::base::SpinLock::unset ( ) [inline]

Release the lock.

Version:
1.0

Definition at line 61 of file spinLock.h.


The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:09 for Equalizer 1.0 by  doxygen 1.7.3