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

📄 eatingstruct.h

📁 本程序是操作系统中比较典型的线程同步算法中的哲学家进餐问题,为防止死锁,采取了两个条件(筷子空闲)同时满足时再允许进餐的办法来解决。期望与大家一起学习交流!
💻 H
字号:
//eatingStruct.h 
//this file including the mutexs and some other important shared varaible
//written in 2004/6/2 23:50


#ifndef EATING_STRUCT_H
#define EATING_STRUCT_H

#define THINKER_NUM 5

typedef struct
{
	HANDLE tropics[THINKER_NUM];
	HANDLE ThreadExit;
	HWND   m_view;
	int    thinkerStatus[THINKER_NUM];
	int    tropicStatus[THINKER_NUM];
	int    ThinkerCnt;
	int     m_speed;
	CRect   userect[THINKER_NUM];
	CRect   Idlerect[THINKER_NUM];
	CRect   thinkerRect[THINKER_NUM];
	

}Thinkers, *pThinkers;

enum
{
	NORMAL_STATUS,
	THINKING_STATUS,
	HUNGRY_STATUS,
	EATING_STATUS
};
//typedef Thinkers* pThinkers;





#endif

⌨️ 快捷键说明

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