TracktionEngine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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...

#include <tracktion_RealTimeSpinLock.h>

Public Member Functions

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

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 graph::RealTimeSpinLock::lock ( )
noexcept

Takes the lock, blocking if necessary.

◆ unlock()

void graph::RealTimeSpinLock::unlock ( )
noexcept

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

◆ try_lock()

bool graph::RealTimeSpinLock::try_lock ( )
noexcept

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


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