template<class T>
struct evo::SmartSleepLock< T >
Smart sleep-locking for synchronization.
- This is associated with a read/write locking object suporting sleeplock() (usually SpinLock), and is used to lock it with a sleep while waiting
- By default you lock with the constructor, and the destructor automatically unlocks (if locked)
- This keeps track of whether it has locked the object, which protects against double lock or unlock here
- Caution: Since this references a synchronization object, that object must be valid as long as this references it
- Caution: Do not share an instance across multiple threads, this is not safe
- Template Parameters
-
T | Sleep-locking synchronization type to use – ex: SpinLock |