TracktionEngine
Public Member Functions | List of all members
tracktion::graph::RealTimeSpinLock Class Reference

A basic spin lock that uses an atomic_flag to store the locked state so should never result in a system call. More...

Public Member Functions

void lock () noexcept
 Takes the lock, blocking if necessary. More...
 
void unlock () noexcept
 Releases the lock, this should only be called after a successful call to try_lock or lock. More...
 
bool try_lock () noexcept
 Attempts to take the lock once, returning true if successful. More...
 

Detailed Description

A basic spin lock that uses an atomic_flag to store the locked state so should never result in a system call.

Note that only try_lock should be called from a real-time thread. If you can't take the lock you should exit quickly.

Member Function Documentation

◆ lock()

void tracktion::graph::RealTimeSpinLock::lock ( )
noexcept

Takes the lock, blocking if necessary.

References try_lock().

◆ unlock()

void tracktion::graph::RealTimeSpinLock::unlock ( )
noexcept

Releases the lock, this should only be called after a successful call to try_lock or lock.

Referenced by tracktion::graph::LockFreeObject< ObjectType >::releaseRealTime().

◆ try_lock()

bool tracktion::graph::RealTimeSpinLock::try_lock ( )
noexcept

Attempts to take the lock once, returning true if successful.

Referenced by lock(), and tracktion::graph::LockFreeObject< ObjectType >::retainRealTime().


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