⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syncobject.h

📁 一个更为先进的嵌入式操作系统.采用RMS线程调度算法,具有信号量等同步对象.亦包括GUI. 通过该系统您可以极大知道Windows的内部秘密.
💻 H
字号:
#ifndef _GOS_SYNCOBJECT_H_
#define _GOS_SYNCOBJECT_H_

class CThread;

class CSyncObject
{
public:	
	virtual BOOL Lock(LONG nTimeOut)=0;
	virtual BOOL Unlock()=0;
	virtual CThread* FindProxy(CThread* pWaiter,LONG nCurTime)=0;
	void LockEx(CThread* pThread,LONG nTimeOut);
protected:
	DWORD m_nData;
};

class CCriticalSection : public CSyncObject
{
public:	
	CCriticalSection();
	virtual BOOL Lock(LONG nTimeOut);
	virtual BOOL Unlock();
	virtual CThread* FindProxy(CThread* pWaiter,LONG nCurTime);
};

class CMutex : public CCriticalSection
{
public:	
	CMutex(CThread* pInitialOwn);
	CMutex(BOOL bInitialOwn);
	virtual CThread* FindProxy(CThread* pWaiter,LONG nCurTime);
};

class CSemaphore : public CSyncObject
{
public:	
	CSemaphore(LONG nInitialCount);
	virtual BOOL Lock(LONG nTimeOut);
	virtual BOOL Unlock();
	virtual CThread* FindProxy(CThread* pWaiter,LONG nCurTime);
public:
	LONG m_nCount;
	LONG m_nIntCount;
};

class CEvent : public CSyncObject
{
public:	
	CEvent(BOOL bInitialOwn,BOOL bManualReset);
	virtual BOOL Lock(LONG nTimeOut);
	virtual BOOL Unlock();
	virtual CThread* FindProxy(CThread* pWaiter,LONG nCurTime);
	BOOL ResetEvent();
	BOOL SetEvent();
};

typedef CSyncObject* PSYNCOBJECT;

#endif //_GOS_SYNCOBJECT_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -