?? pcb.h
字號:
// PCB.h: interface for the PCB class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PCB_H__481A94E2_A86B_4234_BA92_D67AA6E3D468__INCLUDED_)
#define AFX_PCB_H__481A94E2_A86B_4234_BA92_D67AA6E3D468__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//Process state macrol
#define PS_SLEEP 0
#define PS_RUNNING 1
#define PS_SUPPOND 2
#define PS_READY 3
#define PS_NOTHING 4
#define PS_ACTIVE 5
#ifdef DEBUG
static void _IAssert(char* , unsigned); /* 原型 */
#define IASSERT(f) \
if(f) \
NULL; \
else \
_IAssert(__FILE__ , __LINE__)
#else
#define IASSERT(f) NULL
#endif
static void _IAssert(char* strFile, unsigned uLine)
{
CString str;
str.Format("\nAssertion failed: %s, line %u\n",strFile, uLine);
::AfxMessageBox(str);
}
struct PCB
{
public:
PCB(UINT prio, UINT ttime, UINT nid, CString strname);
CString strname; //進程名字
DWORD state; //進程狀態
UINT nid; //進程ID值
UINT priority; //進程靜態優先級
UINT dynprio; //進程的動態優先級
struct PCB * next; //指向下一個進程的指針
struct PCB * prev; //指向上一個進程的指針
UINT current_time; //進程已經運行時間
UINT total_time; //進程運行總時間
UINT sleep_time; //進程的休眠時間
UINT wait_time; //進程的等待總時間
};
struct QueueNode
{
struct PCB* ppcb; //指向進程的指針
struct QueueNode * next; //隊列后導指針
struct QueueNode * prev; //隊列前向指針
QueueNode()
{
ppcb = NULL;
next = this;
prev = this;
}
QueueNode(struct PCB* _ppcb)
{
ppcb = _ppcb;
next = NULL;
prev = NULL;
}
};
#endif // !defined(AFX_PCB_H__481A94E2_A86B_4234_BA92_D67AA6E3D468__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -