WPILibC++ 2024.3.2
wpi::recursive_spinlock1 Class Reference

A recursive spinlock mutex. More...

#include <wpi/spinlock.h>

Public Member Functions

 recursive_spinlock1 () noexcept
 
LLVM_ATTRIBUTE_ALWAYS_INLINE bool try_lock ()
 
LLVM_ATTRIBUTE_ALWAYS_INLINE void lock ()
 
LLVM_ATTRIBUTE_ALWAYS_INLINE void unlock ()
 

Detailed Description

A recursive spinlock mutex.

This version uses std::atomic_flag for spin, then checks the thread id for recursion. It is generally faster on desktop platforms compared to recursive_spinlock2.

Constructor & Destructor Documentation

◆ recursive_spinlock1()

wpi::recursive_spinlock1::recursive_spinlock1 ( )
inlinenoexcept

Member Function Documentation

◆ lock()

LLVM_ATTRIBUTE_ALWAYS_INLINE void wpi::recursive_spinlock1::lock ( )
inline

◆ try_lock()

LLVM_ATTRIBUTE_ALWAYS_INLINE bool wpi::recursive_spinlock1::try_lock ( )
inline

◆ unlock()

LLVM_ATTRIBUTE_ALWAYS_INLINE void wpi::recursive_spinlock1::unlock ( )
inline

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