SameWorldMonitoredCallOpsImpl.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Peter B. Kessler, July 10, 1990 2:39 pm PDT
This is a separate interface, because it locks a separate (dynamic) monitor lock.
DIRECTORY
SameWorldMonitoredCallOps,
CirioNubAccess;
SameWorldMonitoredCallOpsImpl: CEDAR MONITOR
LOCKS monitoredRecordPointer USING monitoredRecordPointer: MonitoredRecordPointer
IMPORTS CirioNubAccess
EXPORTS SameWorldMonitoredCallOps
~ {
MonitoredRecordPointer: TYPE ~ LONG POINTER TO MonitoredRecord;
MonitoredRecord: TYPE ~ MONITORED RECORD [];
MonitoredCall: PUBLIC PROCEDURE [
address: CirioNubAccess.RemoteAddress,
proc: PROCEDURE [] RETURNS []]
RETURNS [] ~ {
IF address.nil THEN CirioNubAccess.RemoteNilFault[address];
IF NOT address.valid THEN CirioNubAccess.RemoteAddrFault[address];
IF proc = NIL THEN RETURN;
{
MonitoredRecordPointerFromAddress: PROCEDURE [
address: CirioNubAccess.RemoteAddress]
RETURNS [LONG POINTER TO MonitoredRecord] ~ TRUSTED {
RETURN [LOOPHOLE[address.byteAddress, LONG POINTER TO MonitoredRecord]];
};
monitoredRecordPointer: LONG POINTER TO MonitoredRecord ~
MonitoredRecordPointerFromAddress[address: address];
MonitoredCallEntry: ENTRY PROCEDURE [
monitoredRecordPointer: MonitoredRecordPointer,
proc: PROCEDURE [] RETURNS []]
RETURNS [] ~ {
ENABLE UNWIND => NULL;
proc[];
RETURN;
};
MonitoredCallEntry[monitoredRecordPointer: monitoredRecordPointer, proc: proc];
};
RETURN;
};
}.