Evo C++ Library v0.5.1
Public Member Functions | Public Attributes | Protected Attributes | List of all members
SmartSleepLock< T > Struct Template Reference

#include <evo/lock.h>

Detailed Description

template<class T>
struct evo::SmartSleepLock< T >

Smart sleep-locking for synchronization.

Template Parameters
TSleep-locking synchronization type to use – ex: SpinLock

Public Member Functions

 SmartSleepLock (T &object, ulong sleep_ms=1)
 Constructor. More...
 
 ~SmartSleepLock ()
 Destructor, unlocks if locked here. More...
 
SmartSleepLocklock (ulong sleep_ms=1)
 Lock object, if not already locked by this. More...
 
SmartSleepLockunlock ()
 Unlock object, if locked by this. More...
 

Public Attributes

T & object_
 Synchronization object to read-lock. More...
 

Protected Attributes

bool locked_
 Whether object is read-locked by this. More...
 

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