mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-30 15:02:18 +01:00
39548: DEBUG for queueing_enabled
This commit is contained in:
parent
b71abea40f
commit
4abbb4b473
3 changed files with 34 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
||||||
2016-10-03 Barton E. Schaefer <schaefer@zsh.org>
|
2016-10-03 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 39548: Src/signals.c, Src/signals.h: DEBUG for queueing_enabled
|
||||||
|
|
||||||
* 39547: Src/Zle/zle_main.c: handle zero delta in calc_timeout()
|
* 39547: Src/Zle/zle_main.c: handle zero delta in calc_timeout()
|
||||||
|
|
||||||
2016-10-03 Peter Stephenson <p.stephenson@samsung.com>
|
2016-10-03 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
|
@ -72,6 +72,10 @@ mod_export int queueing_enabled, queue_front, queue_rear;
|
||||||
mod_export int signal_queue[MAX_QUEUE_SIZE];
|
mod_export int signal_queue[MAX_QUEUE_SIZE];
|
||||||
/**/
|
/**/
|
||||||
mod_export sigset_t signal_mask_queue[MAX_QUEUE_SIZE];
|
mod_export sigset_t signal_mask_queue[MAX_QUEUE_SIZE];
|
||||||
|
#ifdef DEBUG
|
||||||
|
/**/
|
||||||
|
mod_export int queue_in;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Variables used by trap queueing */
|
/* Variables used by trap queueing */
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,6 @@
|
||||||
|
|
||||||
#define MAX_QUEUE_SIZE 128
|
#define MAX_QUEUE_SIZE 128
|
||||||
|
|
||||||
#define queue_signals() (queueing_enabled++)
|
|
||||||
|
|
||||||
#define run_queued_signals() do { \
|
#define run_queued_signals() do { \
|
||||||
while (queue_front != queue_rear) { /* while signals in queue */ \
|
while (queue_front != queue_rear) { /* while signals in queue */ \
|
||||||
sigset_t oset; \
|
sigset_t oset; \
|
||||||
|
@ -94,12 +92,35 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
|
||||||
|
#define queue_signals() (queue_in++, queueing_enabled++)
|
||||||
|
|
||||||
#define unqueue_signals() do { \
|
#define unqueue_signals() do { \
|
||||||
DPUTS(!queueing_enabled, "BUG: unqueue_signals called but not queueing"); \
|
DPUTS(!queueing_enabled, "BUG: unqueue_signals called but not queueing"); \
|
||||||
|
--queue_in; \
|
||||||
if (!--queueing_enabled) run_queued_signals(); \
|
if (!--queueing_enabled) run_queued_signals(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define queue_signal_level() queueing_enabled
|
#define dont_queue_signals() do { \
|
||||||
|
queue_in = queueing_enabled; \
|
||||||
|
queueing_enabled = 0; \
|
||||||
|
run_queued_signals(); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define restore_queue_signals(q) do { \
|
||||||
|
DPUTS2(queueing_enabled && queue_in != q, \
|
||||||
|
"BUG: q = %d != queue_in = %d", q, queue_in); \
|
||||||
|
queue_in = (queueing_enabled = (q)); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#else /* !DEBUG */
|
||||||
|
|
||||||
|
#define queue_signals() (queueing_enabled++)
|
||||||
|
|
||||||
|
#define unqueue_signals() do { \
|
||||||
|
if (!--queueing_enabled) run_queued_signals(); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define dont_queue_signals() do { \
|
#define dont_queue_signals() do { \
|
||||||
queueing_enabled = 0; \
|
queueing_enabled = 0; \
|
||||||
|
@ -108,6 +129,10 @@
|
||||||
|
|
||||||
#define restore_queue_signals(q) (queueing_enabled = (q))
|
#define restore_queue_signals(q) (queueing_enabled = (q))
|
||||||
|
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
#define queue_signal_level() queueing_enabled
|
||||||
|
|
||||||
#ifdef BSD_SIGNALS
|
#ifdef BSD_SIGNALS
|
||||||
#define signal_block(S) sigblock(S)
|
#define signal_block(S) sigblock(S)
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue