KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KISPINLOCK Class Reference

A trivial spinlock implementation with no optimization. More...

#include <spinlock.h>

Public Member Functions

 KISPINLOCK ()
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
bool test ()
 

Private Attributes

std::atomic< bool > m_lock
 

Detailed Description

A trivial spinlock implementation with no optimization.

Don't use if congestion is expected!

Definition at line 29 of file spinlock.h.

Constructor & Destructor Documentation

◆ KISPINLOCK()

KISPINLOCK::KISPINLOCK ( )
inline

Definition at line 32 of file spinlock.h.

Member Function Documentation

◆ lock()

void KISPINLOCK::lock ( )
inline

Definition at line 36 of file spinlock.h.

References m_lock.

◆ test()

bool KISPINLOCK::test ( )
inline

Definition at line 51 of file spinlock.h.

References m_lock.

◆ try_lock()

bool KISPINLOCK::try_lock ( )
inline

Definition at line 41 of file spinlock.h.

References m_lock.

◆ unlock()

void KISPINLOCK::unlock ( )
inline

Definition at line 46 of file spinlock.h.

References m_lock.

Member Data Documentation

◆ m_lock

std::atomic<bool> KISPINLOCK::m_lock
private

Definition at line 57 of file spinlock.h.

Referenced by lock(), test(), try_lock(), and unlock().


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