+ if (SymbolValue(GC_INHIBIT,thread)==NIL) {
+#ifdef LISP_FEATURE_SB_THREAD
+ if (SymbolValue(STOP_FOR_GC_PENDING,thread) != NIL) {
+ /* STOP_FOR_GC_PENDING and GC_PENDING are cleared by
+ * the signal handler if it actually stops us. */
+ sig_stop_for_gc_handler(SIG_STOP_FOR_GC,NULL,context);
+ } else
+#endif
+ if (SymbolValue(GC_PENDING,thread) != NIL) {
+ /* GC_PENDING is cleared in SUB-GC, or if another thread
+ * is doing a gc already we will get a SIG_STOP_FOR_GC and
+ * that will clear it. */
+ maybe_gc(context);
+ }
+ check_blockables_blocked_or_lose();
+ }
+
+#ifndef LISP_FEATURE_WIN32
+ /* we may be here only to do the gc stuff, if interrupts are
+ * enabled run the pending handler */
+ if (SymbolValue(INTERRUPTS_ENABLED,thread) != NIL) {
+ struct interrupt_data *data = thread->interrupt_data;
+
+ /* There may be no pending handler, because it was only a gc
+ * that had to be executed or because pseudo atomic triggered
+ * twice for a single interrupt. For the interested reader,
+ * that may happen if an interrupt hits after the interrupted
+ * flag is cleared but before pseudo-atomic is set and a
+ * pseudo atomic is interrupted in that interrupt. */
+ if (data->pending_handler) {
+
+ /* If we're here as the result of a pseudo-atomic as opposed
+ * to WITHOUT-INTERRUPTS, then INTERRUPT_PENDING is already
+ * NIL, because maybe_defer_handler sets
+ * PSEUDO_ATOMIC_INTERRUPTED only if interrupts are enabled.*/
+ SetSymbolValue(INTERRUPT_PENDING, NIL, thread);
+
+ /* restore the saved signal mask from the original signal (the
+ * one that interrupted us during the critical section) into the
+ * os_context for the signal we're currently in the handler for.
+ * This should ensure that when we return from the handler the
+ * blocked signals are unblocked */
+ sigcopyset(os_context_sigmask_addr(context), &data->pending_mask);
+
+ sigemptyset(&data->pending_mask);
+ /* This will break on sparc linux: the deferred handler really wants
+ * to be called with a void_context */
+ run_deferred_handler(data,(void *)context);
+ }
+ }
+#endif