Public Member Functions | Private Types | Private Attributes
icl_core::thread::SpinLock Class Reference

#include <SpinLock.h>

List of all members.

Public Member Functions

bool lock ()
 SpinLock ()
bool tryLock ()
void unlock ()
 Unlocks the mutex.

Private Types

enum  LockState { LOCKED, UNLOCKED }
 States of the lock. More...

Private Attributes

boost::atomic< LockStatem_state
 Current lock state.

Detailed Description

A spin lock for very short critical sections. Busy-waits until the lock is acquired. Modeled after the example given in the boost::atomic documentation.

Definition at line 35 of file SpinLock.h.


Member Enumeration Documentation

States of the lock.

Enumerator:
LOCKED 
UNLOCKED 

Definition at line 73 of file SpinLock.h.


Constructor & Destructor Documentation

Definition at line 38 of file SpinLock.h.


Member Function Documentation

Locks the mutex. Busy-waits until the mutex can be locked.

Returns:
true. When the function returns the mutex is guaranteed to be locked.

Definition at line 46 of file SpinLock.h.

Tries to lock the mutex without blocking. The mutex is locked if it is available.

Returns:
true if the mutex has been locked, false otherwise.

Definition at line 60 of file SpinLock.h.

Unlocks the mutex.

Definition at line 66 of file SpinLock.h.


Member Data Documentation

Current lock state.

Definition at line 80 of file SpinLock.h.


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


fzi_icl_core
Author(s):
autogenerated on Thu Jun 6 2019 20:22:27