RTOS Wrapper
API reference
Loading...
Searching...
No Matches
Classes
Mutex.h File Reference

Named-mutex wrapper used by BaseThread infrastructure. More...

#include <stdint.h>
#include "OsUtility.h"

Go to the source code of this file.

Classes

class  Mutex
 

Detailed Description

Named-mutex wrapper used by BaseThread infrastructure.

Mutex class definition.

The Mutex class wraps a dynamically created RTOS mutex with a name for debugging. The handle is created in the constructor and destroyed when the Mutex object goes out of scope.

Thread-safety: lock / unlock are safe from any task context (FreeRTOS mutex). Not ISR-safe — use RtosMutex or a critical section for ISRs.

Allocation: one RTOS mutex handle is allocated on construction; no allocation in Lock / Unlock.

For std::lock_guard compatibility use RtosMutex (see RtosMutex.h); this class is the named-handle variant intended for BaseThread infrastructure that exposes the handle by name.

Todo:
Add

The Mutex class provides wrapper for a "named" mutex that is created dynamically created. When the Mutex object goes out of scope, the threadX mustex is deleted.

Todo:
Add