FakeLocalCirioImpl.mesa
Copyright Ó 1990, 1991 by Xerox Corporation. All rights reserved.
Peter B. Kessler, April 18, 1990 10:08:08 pm PDT
DIRECTORY
FakeCirio,
TargetArchitecture,
BreakWorldArchitecture;
FakeLocalCirioImpl: CEDAR MONITOR
LOCKS monitoredRecordPointer USING monitoredRecordPointer: MonitoredRecordPointer
IMPORTS FakeCirio, BreakWorldArchitecture, TargetArchitecture
EXPORTS FakeCirio
~ {
MonitoredRecordPointer: TYPE ~ LONG POINTER TO MonitoredRecord;
MonitoredRecord: TYPE ~ MONITORED RECORD [];
MonitoredCall: PUBLIC BreakWorldArchitecture.MonitoredCallProc ~ {
PROCEDURE [address: Address, proc: PROCEDURE [] RETURNS []] RETURNS []
IF address.IsNullAddress[] THEN {
ERROR FakeCirio.Cant[message: "MonitoredCall[nullAddress]"];
};
IF proc = NIL THEN {
ERROR FakeCirio.Cant[message: "MonitoredCall[nullProc]"];
};
{
monitoredRecordPointer: LONG POINTER TO MonitoredRecord ~
MonitoredRecordPointerFromAddress[address: address];
MonitoredRecordPointerFromAddress: PROCEDURE [
address: BreakWorldArchitecture.Address]
RETURNS [LONG POINTER TO MonitoredRecord] ~ TRUSTED {
targetAddress: TargetArchitecture.Address ~
BreakWorldArchitecture.TargetAddressFromBreakWorldAddress[address: address];
monitoredRecordPointer: LONG POINTER TO MonitoredRecord ~ LOOPHOLE[targetAddress];
IF targetAddress.IsNullAddress[] THEN {
ERROR FakeCirio.Cant[message: "MonitoredRecordPointerFromAddress[nullAddress]"];
};
RETURN [monitoredRecordPointer];
};
MonitoredCallEntry: ENTRY PROCEDURE [
monitoredRecordPointer: MonitoredRecordPointer,
proc: PROCEDURE [] RETURNS []]
RETURNS [] ~ {
ENABLE UNWIND => NULL;
proc[]
};
MonitoredCallEntry[monitoredRecordPointer: monitoredRecordPointer, proc: proc];
};
};
}.