新增:实现 ThreadMutex 类
This commit is contained in:
21
code/ThreadMutex.h
Normal file
21
code/ThreadMutex.h
Normal 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
|
||||
Reference in New Issue
Block a user