RTOS Wrapper
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
RtosMutex Class Reference

#include <RtosMutex.h>

Public Member Functions

 RtosMutex () noexcept
 
 ~RtosMutex () noexcept
 
 RtosMutex (const RtosMutex &)=delete
 
RtosMutex & operator= (const RtosMutex &)=delete
 
 RtosMutex (RtosMutex &&other) noexcept
 
RtosMutex & operator= (RtosMutex &&other) noexcept
 
bool lock () noexcept
 Lock the mutex, blocking indefinitely.
 
bool try_lock () noexcept
 Try to lock the mutex without blocking.
 
bool try_lock_for (uint32_t timeout_ms) noexcept
 Try to lock the mutex with a timeout.
 
void unlock () noexcept
 Unlock the mutex.
 
OS_Mutex native_handle () const noexcept
 Get the native RTOS handle (platform-specific).
 
bool Take (uint32_t timeout_ms=0) noexcept
 Take (lock) the mutex with optional timeout.
 
void Give () noexcept
 Give (unlock) the mutex.
 
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

OS_Mutex handle_
 

Constructor & Destructor Documentation

◆ RtosMutex() [1/3]

RtosMutex::RtosMutex ( )
noexcept

◆ ~RtosMutex()

RtosMutex::~RtosMutex ( )
noexcept

◆ RtosMutex() [2/3]

RtosMutex::RtosMutex ( const RtosMutex &  )
delete

◆ RtosMutex() [3/3]

RtosMutex::RtosMutex ( RtosMutex &&  other)
noexcept

Member Function Documentation

◆ Give()

void RtosMutex::Give ( )
inlinenoexcept

Give (unlock) the mutex.

◆ lock()

bool RtosMutex::lock ( )
noexcept

Lock the mutex, blocking indefinitely.

Returns
true if successfully locked.

◆ lock_shared()

bool RtosMutex::lock_shared ( )
inlinenoexcept

◆ native_handle()

OS_Mutex RtosMutex::native_handle ( ) const
inlinenoexcept

Get the native RTOS handle (platform-specific).

Returns
The underlying OS_Mutex handle.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

RtosMutex & RtosMutex::operator= ( RtosMutex &&  other)
noexcept

◆ Take()

bool RtosMutex::Take ( uint32_t  timeout_ms = 0)
inlinenoexcept

Take (lock) the mutex with optional timeout.

Parameters
timeout_msTimeout in milliseconds (0 = block forever).
Returns
true if successfully taken.

◆ try_lock()

bool RtosMutex::try_lock ( )
noexcept

Try to lock the mutex without blocking.

Returns
true if successfully locked.

◆ try_lock_for()

bool RtosMutex::try_lock_for ( uint32_t  timeout_ms)
noexcept

Try to lock the mutex with a timeout.

Parameters
timeout_msMaximum time to wait in milliseconds.
Returns
true if successfully locked within the timeout.

◆ try_lock_shared()

bool RtosMutex::try_lock_shared ( )
inlinenoexcept

◆ try_lock_shared_for()

bool RtosMutex::try_lock_shared_for ( uint32_t  timeout_ms)
inlinenoexcept

◆ unlock()

void RtosMutex::unlock ( )
noexcept

Unlock the mutex.

◆ unlock_shared()

void RtosMutex::unlock_shared ( )
inlinenoexcept

Member Data Documentation

◆ handle_

OS_Mutex RtosMutex::handle_
private

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