INTERFACEThis interface provides the runtime shutdown routines.RTProcess ;
PROCEDURE RegisterExitor (p: PROCEDURE ());
Registers the procedure p to be executed when Exit is called. The registered procedures are executed in reverse of the order they were registered.
PROCEDURE Exit (n: INTEGER);
call the registered exitors and terminate the program with statusn
. Terminating a Modula-3 program by ``falling off the end'' is like callingExit(0)
.
PROCEDURE Crash (msg: TEXT);
Call the registered exitors and terminate the program with the
error message msg
. If possible, invoke a debugger or generate a
core dump.
PROCEDURE InvokeExitors ();
Run the registered exit procedures, at most once.
PROCEDURE OnInterrupt (p: InterruptHandler): InterruptHandler;
Register 'p' as the handler to be called on the next interrupt
signal
and return the currently registered handler. Note that 'p' must be NIL
or a top-level procedure.
TYPE InterruptHandler = PROCEDURE (); PROCEDURE RegisterInterruptSetup (enable, disable: PROCEDURE ());
Registersenable
anddisable
as the machine-specific setup procedures to enable and disable respectively control-C handling.
TYPE ForkHandler = PROCEDURE();RegisterForkHandlers = pthread_atfork or just 0 on Win32.
<* EXTERNAL RTProcess__RegisterForkHandlers *> PROCEDURE RegisterForkHandlers(prep, parent, child: ForkHandler): INTEGER; <* EXTERNAL RTProcess__Fork *> PROCEDURE Fork(): INTEGER; END RTProcess.