Cmplr8Mntr1:
MONITOR
EXPORTS Cmplr8Mntr1Defs =
BEGIN
CounterType: PUBLIC TYPE = RECORD [active: INTEGER, inactive: INTEGER];
counter: PUBLIC CounterType ¬ [10, 15];
Activate:
PUBLIC
ENTRY
PROCEDURE =
BEGIN
ENABLE UNWIND => NULL;
counter.active ¬ counter.active + 1;
counter.inactive ¬ counter.inactive - 1;
END;
DeActivate:
PUBLIC
ENTRY
PROCEDURE =
BEGIN
ENABLE UNWIND => NULL;
counter.active ¬ counter.active - 1;
counter.inactive ¬ counter.inactive + 1;
END;
Inspect:
PUBLIC
ENTRY
PROCEDURE
RETURNS [
BOOL] =
BEGIN
ENABLE UNWIND => NULL;
IF counter.active + counter.inactive = 25 THEN RETURN[TRUE] ELSE RETURN[FALSE];
END;
END...