You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
389 B
29 lines
389 B
#pragma once
|
|
#include "zbasic.h"
|
|
namespace iflytop {
|
|
|
|
class zmutex {
|
|
public:
|
|
SemaphoreHandle_t recursiveMutex;
|
|
const char* name = nullptr;
|
|
|
|
public:
|
|
zmutex(const char* name);
|
|
~zmutex();
|
|
|
|
void init();
|
|
bool isInit();
|
|
|
|
void lock();
|
|
void unlock();
|
|
};
|
|
|
|
class zlock_guard {
|
|
zmutex& m_mutex;
|
|
|
|
public:
|
|
zlock_guard(zmutex& mutex);
|
|
~zlock_guard();
|
|
};
|
|
|
|
} // namespace iflytop
|