26 lines
528 B
Modula-2
26 lines
528 B
Modula-2
|
DEFINITION MODULE Processes;
|
||
|
|
||
|
TYPE SIGNAL;
|
||
|
|
||
|
PROCEDURE StartProcess(P: PROC; n: CARDINAL);
|
||
|
(* Start a concurrent process with program "P" and workspace of
|
||
|
size "n"
|
||
|
*)
|
||
|
|
||
|
PROCEDURE SEND(VAR s: SIGNAL);
|
||
|
(* One process waiting for "s" is resumed
|
||
|
*)
|
||
|
|
||
|
PROCEDURE WAIT(VAR s: SIGNAL);
|
||
|
(* Wait for some other process to send "s"
|
||
|
*)
|
||
|
|
||
|
PROCEDURE Awaited(s: SIGNAL): BOOLEAN;
|
||
|
(* Return TRUE if at least one process is waiting for sinal "s".
|
||
|
*)
|
||
|
|
||
|
PROCEDURE Init(VAR s: SIGNAL);
|
||
|
(* Compulsory initialization
|
||
|
*)
|
||
|
END Processes.
|