PASPROC.DEF 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. (* Release 3.10 *)
  2. (*-------------------------------------------------------------------------*
  3. * *
  4. * PASPROC.DEF - Modula-2 interface to PASPROC.ITF *
  5. * *
  6. * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. *
  7. * All Rights Reserved *
  8. * *
  9. *--------------------------------------------------------------------------*)
  10. (*# project("#set tspas='on'") *)
  11. (*# call(o_a_copy => on,
  12. o_a_size => on,
  13. near_call=>off) *)
  14. (*# call(seg_name => PASPROC) *)
  15. (*# module(implementation=>off) *)
  16. DEFINITION MODULE PasProc;
  17. CONST
  18. MaxProcess = 32;
  19. TYPE SIGNAL;
  20. PROCEDURE StartScheduler;
  21. (* start the time sliced scheduler *)
  22. PROCEDURE StopScheduler;
  23. (* stops the time sliced scheduler *)
  24. PROCEDURE StartProcess(P: PROC; N: CARDINAL; Pr: CARDINAL);
  25. (* Start a new process *)
  26. PROCEDURE StopProcess();
  27. (* Stops current thread *)
  28. PROCEDURE SEND(s: SIGNAL);
  29. (* Send a signal *)
  30. PROCEDURE WAIT(s: SIGNAL);
  31. (* Wait for signal *)
  32. PROCEDURE Notify(s: SIGNAL);
  33. (*
  34. Causes a task waiting on signal s to be scheduled when possible,
  35. (e.g. at next time slice).
  36. If no-one is waiting on s then the call has NO effect.
  37. This call CANNOT cause reschedule, so may be used by an interrupt
  38. handler to safely notify another process of an events occurance.
  39. *)
  40. PROCEDURE Awaited(s: SIGNAL) : BOOLEAN;
  41. (* Returns if any process are waiting on signal *)
  42. PROCEDURE Init(VAR s: SIGNAL);
  43. (* Initialize a signal *)
  44. (*# save, call(c_conv=>on) *)
  45. PROCEDURE Delay(T: CARDINAL);
  46. (* delays for at least T timeslices *)
  47. (*# restore *)
  48. (*# save, call(reg_saved=>(ax,bx,cx,dx,di,si,ds,es,st1,st2)) *)
  49. PROCEDURE Lock;
  50. (*
  51. Critical region lock. Prevents the current process from
  52. being de-scheduled by timeslicing, until a call to Unlock.
  53. Calls to Lock may be nested.
  54. *)
  55. PROCEDURE Unlock;
  56. (*# restore *)
  57. (* Unlock procedure, always paired with a call to Lock. *)
  58. PROCEDURE Idler;
  59. END PasProc.
  60.