smart-fursuit-tail-esp32/embedded/src/mutex.hpp

18 lines
303 B
C++

#ifndef MUTEX_HPP
#define MUTEX_HPP
#include <functional>
#include "Arduino.h"
#include "freertos/semphr.h"
class Mutex {
SemaphoreHandle_t _mutex;
public:
Mutex();
bool taken();
bool acquire();
void release();
bool run(std::function<void()> f, bool blocking=false);
};
#endif