ucommon::atomic::spinlock Class Reference

Atomic spinlock class. More...

#include <atomic.h>

Public Member Functions

bool acquire (void)
 Acquire the lock.
void release (void)
 Release an acquired spinlock.
 spinlock ()
 Construct and initialize spinlock.

Detailed Description

Atomic spinlock class.

Used as high-performance sync lock between threads.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 80 of file atomic.h.


Member Function Documentation

bool ucommon::atomic::spinlock::acquire ( void   ) 

Acquire the lock.

If the lock is not acquired, one "spins" by doing something else. One suggestion is using thread::yield.

Returns:
true if acquired.

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

Generated on 30 Jul 2013 for UCommon by  doxygen 1.6.1