- Set the Prolog flag exit_status
- Call all hooks registered using at_halt/1.
If Status equals 0 (zero), any of these hooks calls cancel_halt/1,
termination is cancelled.
- Call all hooks registered using PL_at_halt(). In the future,
if any of these hooks returns non-zero, termination will be cancelled.
Currently, this only prints a warning.
- Perform the following system cleanup actions:
- Cancel all threads, calling thread_at_exit/1 registered termination hooks. Threads not responding within 1 second are cancelled forcefully.
- Flush I/O and close all streams except for standard I/O.
- Reset the terminal if its properties were changed.
- Remove temporary files and incomplete compilation output.
- Reclaim memory.
- Call exit(Status) to terminate the process
- Termination cannot be cancelled with cancel_halt/1.
- abort() is called instead of exit(Status).
In addition to an integer status name we also allow passing a
signal name. This is similar to
halt cancellation and set the termination code to 128+signum. For
halt(term) the system exits with status 143
(= 128+15) on Linux.