summary refs log tree commit diff
path: root/Src/signals.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/signals.h')
-rw-r--r--Src/signals.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/Src/signals.h b/Src/signals.h
index 4b8197d84..e86906ebc 100644
--- a/Src/signals.h
+++ b/Src/signals.h
@@ -101,6 +101,23 @@
 
 #define restore_queue_signals(q) (queueing_enabled = (q))
 
+/*
+ * Similar (but simpler) mechanism used for queueing traps.
+ * Only needed if NO_TRAPS_ASYNC is set.
+ */
+#define queue_traps()	(trap_queueing_enabled++)
+
+#define run_queued_traps() do { \
+    while (trap_queue_front != trap_queue_rear) { /* while traps in queue */ \
+	trap_queue_front = (trap_queue_front + 1) % MAX_QUEUE_SIZE; \
+	dotrap(trap_queue[trap_queue_front]);  /* handle queued trap   */ \
+    } \
+} while (0)
+
+#define dont_queue_traps() do { \
+    trap_queueing_enabled = 0; \
+    run_queued_traps(); \
+} while (0)
 
 /* Make some signal functions faster. */