COROUTIN.DEF 789 B

1234567891011121314151617181920
  1. (* ========================================================= *)
  2. (* Preliminary library module for Gardens Point Modula *)
  3. (* ========================================================= *)
  4. FOREIGN DEFINITION MODULE Coroutines;(* coroutines as in PIM *)
  5. IMPORT IMPLEMENTATION FROM "coroutines.obj";
  6. FROM SYSTEM IMPORT ADDRESS;
  7. TYPE Coroutine = ADDRESS; (* use of this type avoids SYSTEM import *)
  8. PROCEDURE NEWPROCESS (code : PROC; (* body of coroutine *)
  9. space : ADDRESS; (* ptr to workspace *)
  10. size : CARDINAL; (* size of workspace *)
  11. VAR this : Coroutine); (* returned coroutine *)
  12. PROCEDURE TRANSFER (VAR thisCo : Coroutine; (* current saved here *)
  13. VAR destCo : Coroutine); (* target to activate *)
  14. END Coroutines.