Support building without PSEUDO-ATOMIC on POSIX safepoints
- Mark Lisp signal handlers with a flag `synchronous' to indicate
whether we can (and must) handle them immediately. Conversely,
we understand this flag to imply a guarantee that the signal
does not occur during allocation.
- Any signal with a Lisp handler that is not synchronous is
implemented in the runtime using a trampoline, which (instead of
invoking Lisp code directly) first spawns a new pthread, which
only then calls back into Lisp to invoke the handler function
(with a fake signal context).
- Used in particular for SIGINT.
- For SIGPROF, introduce a second per-thread allocation region,
which gets swapped with the usual region around the call into
SIGPROF-HANDLER. This handler is a special case, because it is
careful not to trigger GC nor non-local unwinds, and we can
safely return to the original region afterwards.
- Add a new subclass SIGNAL-HANDLER-THREAD for this purpose,
making it easy to identify these threads (e.g. in the test
driver).
- Run sprof tests while building the contrib. Add a test stressing
time profiling of allocation sequences.
Enable using :SB-SAFEPOINT-STRICTLY on features.
Quite usable already on x86 and x86-64; PPC still has more prominent
issues, e.g. in threads.impure.lisp.
21 files changed: