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

📄 producer.h.svn-base

📁 德国Erlangen大学教学操作系统源码。
💻 SVN-BASE
字号:
#ifndef __producer_include__#define __producer_include__#include "syscall/guarded_semaphore.h"#include "user/appl.h"Guarded_Semaphore sem;class Producer : public Application{public:	Producer(void* tos, int row) : Application(tos, row) {}		virtual ~Producer() {}		void action ()	{		int i = 1;		while(true) {			sem.signal();			do {				Secure lock;				int type_x, type_y;				kout.getpos(type_x, type_y);				kout.setpos(0, _row);				kout << _row << " producer signal: " << i++ << endl;				kout.flush();				kout.setpos(type_x, type_y);			} while(0);			for(int j = 0; j<100000; j++);		}	}};#endif

⌨️ 快捷键说明

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