Added destructor to CMSIS_RTOS2 mutex

This commit is contained in:
John Wellbelove 2023-08-26 10:46:05 +01:00
parent c92ab94220
commit 5402a3ed14

View File

@ -44,12 +44,17 @@ namespace etl
public:
mutex()
: id(0)
: id(NULL)
{
osMutexAttr_t attr = { "ETL", osMutexRecursive | osMutexPrioInherit | osMutexRobust, 0, 0 };
id = osMutexNew(&attr);
}
~mutex()
{
osMutexDelete(id);
}
void lock()
{
osMutexAcquire(id, osWaitForever);