coroutine.h.svn-base

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

SVN-BASE
39
字号
/*****************************************************************************//* Betriebssysteme                                                           *//*---------------------------------------------------------------------------*//*                                                                           *//*                          C O R O U T I N E                                *//*                                                                           *//*---------------------------------------------------------------------------*//* Implementierung des Koroutinenkonzepts.                                   *//* Im Konstruktor wird der initialie Kontext der Koroutine eingerichtet.     *//* Mit go() wird die erste Koroutine aktiviert. Alle weiteren                *//* Koroutinenwechsel sollten mit resume() erfolgen.                          *//* Um bei einem Koroutinenwechsel den Kontext sichern zu koennen, enthaelt   *//* jedes Koroutinenobjekt eine Struktur toc, in dem die Werte der nicht-     *//* fluechtigen Register gesichert werden koennen.                            *//*****************************************************************************/#ifndef __Coroutine_include__#define __Coroutine_include__#include "machine/toc.h"class Coroutine{public:	Coroutine ();	Coroutine (void* tos);	Coroutine (Coroutine &task);	virtual ~Coroutine();		void go ();	void resume (Coroutine& next);	virtual void action () = 0;private:	struct toc _toc;};#endif

⌨️ 快捷键说明

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