FreeRTOS Addons
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cpp_freertos::MutexStandard Class Reference

#include <mutex.hpp>

Inheritance diagram for cpp_freertos::MutexStandard:
cpp_freertos::Mutex

Public Member Functions

 MutexStandard ()
 
virtual bool Lock (TickType_t Timeout=portMAX_DELAY)
 
virtual bool Unlock ()
 
- Public Member Functions inherited from cpp_freertos::Mutex
virtual ~Mutex ()
 
virtual bool Lock (TickType_t Timeout=portMAX_DELAY)=0
 
virtual bool Unlock ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from cpp_freertos::Mutex
 Mutex ()
 
- Protected Attributes inherited from cpp_freertos::Mutex
SemaphoreHandle_t handle
 

Detailed Description

Standard usage Mutex. By default calls to Lock these objects block forever, but this can be changed by simply passing in a argument to the Lock() method. These objects are not recursively acquirable. Calling Lock() twice from the same Thread (i.e. task) will deadlock.

Note
Standard mutexes use less resources than recursive mutexes. You should typically use this type of Mutex, unless you have a strong need for a MutexRecursive mutex.

Constructor & Destructor Documentation

◆ MutexStandard()

MutexStandard::MutexStandard ( )

Create a standard, non-recursize Mutex.

Exceptions
ThreadMutexExceptionon failure.

Member Function Documentation

◆ Lock()

bool MutexStandard::Lock ( TickType_t  Timeout = portMAX_DELAY)
virtual

Lock the Mutex.

Parameters
TimeoutHow long to wait to get the Lock until giving up.
Returns
true if the Lock was acquired, false if it timed out.

Implements cpp_freertos::Mutex.

◆ Unlock()

bool MutexStandard::Unlock ( )
virtual

Unlock the Mutex.

Returns
true if the Lock was released, false if it failed. (Hint, if it fails, did you call Lock() first?)

Implements cpp_freertos::Mutex.


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