Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::mt::SpinLock Class Referencefinal

Non-recursive spin lock backed by an atomic flag. More...

#include <spinlock.h>

Public Member Functions

 SpinLock (const SpinLock &)=delete
 
SpinLockoperator= (const SpinLock &)=delete
 
bool try_lock ()
 Attempts to acquire the lock without waiting.
 
void lock ()
 Spins until the lock is acquired.
 
void unlock ()
 Releases the lock.
 

Detailed Description

Non-recursive spin lock backed by an atomic flag.

Member Function Documentation

◆ try_lock()

bool gaia::mt::SpinLock::try_lock ( )
inline

Attempts to acquire the lock without waiting.

Returns
True when the lock was acquired.

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