process.def 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. (* Copyright (C) 1987 Jensen & Partners International *)
  2. DEFINITION MODULE Process;
  3. TYPE SIGNAL;
  4. PROCEDURE StartScheduler;
  5. (* start the time sliced scheduler *)
  6. PROCEDURE StopScheduler;
  7. (* stops the time sliced scheduler *)
  8. PROCEDURE StartProcess(P: PROC; N: CARDINAL; Pr: CARDINAL);
  9. (* Start a new process *)
  10. PROCEDURE SEND(s: SIGNAL);
  11. (* Send a signal *)
  12. PROCEDURE WAIT(s: SIGNAL);
  13. (* Wait for signal *)
  14. PROCEDURE Notify(s: SIGNAL);
  15. (*
  16. Causes a task waiting on signal s to be scheduled when possible,
  17. (e.g. at next time slice).
  18. If no-one is waiting on s then the call has NO effect.
  19. This call CANNOT cause reschedule, so may be used by an interrupt
  20. handler to safely notify another process of an events occurance.
  21. *)
  22. PROCEDURE Awaited(s: SIGNAL) : BOOLEAN;
  23. (* Returns if any process are waiting on signal *)
  24. PROCEDURE Init(VAR s: SIGNAL);
  25. (* Initialize a signal *)
  26. PROCEDURE Delay(T: CARDINAL);
  27. (* delays for at least T timeslices *)
  28. PROCEDURE Lock;
  29. (*
  30. Critical region lock. Prevents the current process from
  31. being de-scheduled by timeslicing, until a call to Unlock.
  32. Calls to Lock may be nested.
  33. *)
  34. PROCEDURE Unlock;
  35. (* Unlock procedure, always paired with a call to Lock. *)
  36. END Process.
  37.