新增:实现 ThreadMutex 类

This commit is contained in:
2025-09-01 16:35:25 +08:00
commit 9958d730d9
8 changed files with 259 additions and 0 deletions

21
code/ThreadMutex.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef THREADMUTE_H
#define THREADMUTE_H
#include <pthread.h>
#include <unistd.h>
class ThreadMutex
{
public:
int XLockGetTestFlag(void);
bool XLockTryLock(int tInputWait10Ms, int tInputTestFlag = -1);
void XLockUnLock(void);
ThreadMutex(void);
~ThreadMutex();
private:
pthread_mutex_t mMutex_;
int mCurTestFlag_;
};
#endif