Some operations, such as allocation, consist of several steps and
temporarily break for instance gc invariants. Interrupting said
operations is therefore dangerous to one's health. Blocking the
signals for each allocation is out of question as the overhead of the
sigsetmask system calls would be enormous. Instead, pseudo
atomic sections are implemented with a simple flag.
When a deferrable signal is delivered to a thread within a pseudo atomic section the pseudo-atomic-interrupted flag is set, the signal and its context are stored, and all deferrable signals blocked. This is to guarantee that there is at most one pending handler in SBCL. While the signals are blocked, the responsibilty of keeping track of other pending signals lies with the OS.
On leaving the pseudo atomic section, the pending handler is run and the signals are unblocked.
Similar to pseudo atomic,
WITHOUT-INTERRUPTS defers deferrable
signals in its thread until the end of its body, provided it is not
nested in another
Not so frequently used as pseudo atomic,
benefits less from the deferral mechanism.
Something of a special case, a signal that is blockable but not
is deferred by pseudo atomic and