File: PlotMonitor.mesa
Last Edited by: SChen, August 9, 1984 8:31:04 pm PDT
DIRECTORY
PlotOps USING [Handle];
PlotMonitor: CEDAR MONITOR
EXPORTS PlotOps = {
OPEN PlotOps;
Lock: PUBLIC ENTRY PROC [handle: Handle] = {
ENABLE UNWIND => NULL;
IF handle = NIL THEN RETURN;
WHILE handle.locked DO WAIT handle.unlocked; ENDLOOP;
handle.locked ← TRUE;
}; -- Lock
Unlock: PUBLIC ENTRY PROC [handle: Handle] = {
Unlock releases the paint lock, ignore NIL handle (could be a destroy race).
ENABLE UNWIND => NULL;
IF handle # NIL THEN {
handle.locked ← FALSE;
BROADCAST handle.unlocked;
};
}; -- Unlock
}.