HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
PlatformSharedMutex Class Reference

#include <PlatformMutex.h>

Public Member Functions

 PlatformSharedMutex () noexcept
 
 ~PlatformSharedMutex () noexcept
 
 PlatformSharedMutex (const PlatformSharedMutex &)=delete
 
PlatformSharedMutexoperator= (const PlatformSharedMutex &)=delete
 
 PlatformSharedMutex (PlatformSharedMutex &&other) noexcept
 
PlatformSharedMutexoperator= (PlatformSharedMutex &&other) noexcept
 
bool lock () noexcept
 
bool try_lock () noexcept
 
bool try_lock_for (uint32_t timeout_ms) noexcept
 
void unlock () noexcept
 
bool lock_shared () noexcept
 
bool try_lock_shared () noexcept
 
bool try_lock_shared_for (uint32_t timeout_ms) noexcept
 
void unlock_shared () noexcept
 

Private Attributes

SemaphoreHandle_t writer_mutex_
 
SemaphoreHandle_t reader_mutex_
 
std::atomic< int > readers_
 
std::atomic< bool > writer_active_
 

Constructor & Destructor Documentation

◆ PlatformSharedMutex() [1/3]

PlatformSharedMutex::PlatformSharedMutex ( )
inlinenoexcept

◆ ~PlatformSharedMutex()

PlatformSharedMutex::~PlatformSharedMutex ( )
inlinenoexcept

◆ PlatformSharedMutex() [2/3]

PlatformSharedMutex::PlatformSharedMutex ( const PlatformSharedMutex & )
delete

◆ PlatformSharedMutex() [3/3]

PlatformSharedMutex::PlatformSharedMutex ( PlatformSharedMutex && other)
inlinenoexcept

Member Function Documentation

◆ lock()

bool PlatformSharedMutex::lock ( )
inlinenoexcept

◆ lock_shared()

bool PlatformSharedMutex::lock_shared ( )
inlinenoexcept

◆ operator=() [1/2]

PlatformSharedMutex & PlatformSharedMutex::operator= ( const PlatformSharedMutex & )
delete

◆ operator=() [2/2]

PlatformSharedMutex & PlatformSharedMutex::operator= ( PlatformSharedMutex && other)
inlinenoexcept

◆ try_lock()

bool PlatformSharedMutex::try_lock ( )
inlinenoexcept

◆ try_lock_for()

bool PlatformSharedMutex::try_lock_for ( uint32_t timeout_ms)
inlinenoexcept

◆ try_lock_shared()

bool PlatformSharedMutex::try_lock_shared ( )
inlinenoexcept

◆ try_lock_shared_for()

bool PlatformSharedMutex::try_lock_shared_for ( uint32_t timeout_ms)
inlinenoexcept

◆ unlock()

void PlatformSharedMutex::unlock ( )
inlinenoexcept

◆ unlock_shared()

void PlatformSharedMutex::unlock_shared ( )
inlinenoexcept

Member Data Documentation

◆ reader_mutex_

SemaphoreHandle_t PlatformSharedMutex::reader_mutex_
private

◆ readers_

std::atomic<int> PlatformSharedMutex::readers_
private

◆ writer_active_

std::atomic<bool> PlatformSharedMutex::writer_active_
private

◆ writer_mutex_

SemaphoreHandle_t PlatformSharedMutex::writer_mutex_
private

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