consumer.h.svn-base

来自「德国Erlangen大学教学操作系统源码。」· SVN-BASE 代码 · 共 36 行

SVN-BASE
36
字号
#ifndef __Consumer_include__#define __Consumer_include__#include "syscall/guarded_semaphore.h"#include "user/appl.h"extern Guarded_Semaphore sem;class Consumer : public Application{public:	Consumer(void* tos, int row) : Application(tos, row) {}		virtual ~Consumer() {}		void action ()	{		int i = 1;		while(true) {			sem.wait();			do {				Secure lock;				int type_x, type_y;				kout.getpos(type_x, type_y);				kout.setpos(0, _row);				kout << _row << " customer waited: " << i++ << endl;				kout.flush();				kout.setpos(type_x, type_y);			} while(0);		}	}};#endif

⌨️ 快捷键说明

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