Evo C++ Library v0.5.1
Public Types | Public Member Functions | List of all members
SpinLock Struct Reference

#include <evo/thread.h>

Inheritance diagram for SpinLock:
Inheritance graph
[legend]

Detailed Description

Spin-lock for thread synchronization.

Public Types

typedef SmartLock< AtomicFlagLock
 Lock object type – see SmartLock. More...
 
typedef SmartSleepLock< AtomicFlagSleepLock
 Sleep-Lock object type – see SmartSleepLock. More...
 

Public Member Functions

 SpinLock ()
 Constructor. More...
 
void clear (MemOrder mem_order=std::memory_order_seq_cst)
 Clear flag (set to false). More...
 
void lock ()
 Spin-lock flag. More...
 
void sleeplock (ulong ms=1)
 Spin-lock flag with a sleep. More...
 
bool test_and_set (MemOrder mem_order=std::memory_order_seq_cst)
 Atomically set flag (to true) and return the previous value. More...
 
void unlock ()
 Spin-unlock flag. More...
 

Member Typedef Documentation

◆ Lock

Lock object type – see SmartLock.

◆ SleepLock

Sleep-Lock object type – see SmartSleepLock.

Constructor & Destructor Documentation

◆ SpinLock()

SpinLock ( )
inline

Constructor.


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