HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
TmcMutexGuard Class Reference

RAII mutex guard for automatic lock/unlock. More...

#include <esp32_tmc_mutex.hpp>

Collaboration diagram for TmcMutexGuard:
[legend]

Public Member Functions

 TmcMutexGuard (Esp32TmcMutex &mutex) noexcept
 Lock mutex (blocks until acquired)
 
 ~TmcMutexGuard () noexcept
 Unlock mutex (automatically called on destruction)
 
void unlock () noexcept
 Manually unlock mutex.
 
bool is_locked () const noexcept
 Check if mutex is currently locked by this guard.
 

Private Attributes

Esp32TmcMutexmutex_
 
bool locked_
 

Detailed Description

RAII mutex guard for automatic lock/unlock.

Automatically locks mutex on construction and unlocks on destruction. Provides exception-safe mutex locking.

Constructor & Destructor Documentation

◆ TmcMutexGuard()

TmcMutexGuard::TmcMutexGuard ( Esp32TmcMutex & mutex)
inlineexplicitnoexcept

Lock mutex (blocks until acquired)

Here is the call graph for this function:

◆ ~TmcMutexGuard()

TmcMutexGuard::~TmcMutexGuard ( )
inlinenoexcept

Unlock mutex (automatically called on destruction)

Here is the call graph for this function:

Member Function Documentation

◆ is_locked()

bool TmcMutexGuard::is_locked ( ) const
inlinenoexcept

Check if mutex is currently locked by this guard.

◆ unlock()

void TmcMutexGuard::unlock ( )
inlinenoexcept

Manually unlock mutex.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ locked_

bool TmcMutexGuard::locked_
private

◆ mutex_

Esp32TmcMutex& TmcMutexGuard::mutex_
private

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