Boboter
Loading...
Searching...
No Matches
smart_mutex.h
Go to the documentation of this file.
1
7
8#pragma once
9
10#include <freertos/FreeRTOS.h>
11
23private:
24 SemaphoreHandle_t mutex;
25
26public:
27 explicit smart_mutex(SemaphoreHandle_t mutex) : mutex(mutex) {
28 xSemaphoreTake(mutex, portMAX_DELAY);
29 }
30
32 xSemaphoreGive(mutex);
33 }
34
35 smart_mutex(const smart_mutex&) = delete;
37};
smart_mutex(SemaphoreHandle_t mutex)
Definition smart_mutex.h:27
smart_mutex & operator=(const smart_mutex &)=delete
~smart_mutex()
Definition smart_mutex.h:31
smart_mutex(const smart_mutex &)=delete