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

#include <Mutex.h>

Public Member Functions

 Mutex (const char *name, const char *nameExtension=0) noexcept
 The constructor.
 
 Mutex (const Mutex &copy)=delete
 The Copy constructor is deleted to avoid copying instances.
 
Mutex & operator= (const Mutex &copy)=delete
 The assignment operator constructor is deleted to avoid copying instances.
 
 ~Mutex ()
 The destructor deletes the mutex.
 
bool IsInitialized () const noexcept
 Accessor function to support testing.
 
bool Lock (uint32_t maxMsecToWait) noexcept
 This function locks the mutex.
 
bool Unlock () noexcept
 This function unlocks the mutex.
 
uint32_t GetOwnershipCount () const noexcept
 
const char * GetName () const noexcept
 
bool EnsureInitialized () noexcept
 

Static Public Attributes

static constexpr uint32_t MaxNameLength = 39U
 

Private Attributes

OS_Mutex mutex
 
char mutexName [MaxNameLength+1]
 
bool initialized
 

Constructor & Destructor Documentation

◆ Mutex() [1/2]

Mutex::Mutex ( const char *  name,
const char *  nameExtension = 0 
)
noexcept

◆ Mutex() [2/2]

Mutex::Mutex ( const Mutex &  copy)
delete

The Copy constructor is deleted to avoid copying instances.

Returns
n/a

◆ ~Mutex()

Mutex::~Mutex ( )

The destructor deletes the mutex.

Member Function Documentation

◆ EnsureInitialized()

bool Mutex::EnsureInitialized ( )
inlinenoexcept

◆ GetName()

const char * Mutex::GetName ( ) const
inlinenoexcept

◆ GetOwnershipCount()

uint32_t Mutex::GetOwnershipCount ( ) const
inlinenoexcept

◆ IsInitialized()

bool Mutex::IsInitialized ( ) const
inlinenoexcept

Accessor function to support testing.

◆ Lock()

bool Mutex::Lock ( uint32_t  maxMsecToWait)
noexcept

This function locks the mutex.

Parameters
maxMsecToWaitMax time to wait before timing out

◆ operator=()

Mutex & Mutex::operator= ( const Mutex &  copy)
delete

The assignment operator constructor is deleted to avoid copying instances.

Returns
n/a

◆ Unlock()

bool Mutex::Unlock ( )
noexcept

This function unlocks the mutex.

Member Data Documentation

◆ initialized

bool Mutex::initialized
private

◆ MaxNameLength

constexpr uint32_t Mutex::MaxNameLength = 39U
staticconstexpr

◆ mutex

OS_Mutex Mutex::mutex
private

◆ mutexName

char Mutex::mutexName[MaxNameLength+1]
private

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