# HG changeset patch # User Richard M. Stallman # Date 1110124784 0 # Node ID 306f7ce8d80de774d7ccbb2e58c8ba04b367cac3 # Parent fe3c6e97ccc6fbe29d7275988d293144a6b7a329 (UNBLOCK_INPUT_TO): New macro. (TOTALLY_UNBLOCK_INPUT): Handle a pending signal if any. diff -r fe3c6e97ccc6 -r 306f7ce8d80d src/blockinput.h --- a/src/blockinput.h Sun Mar 06 00:48:46 2005 +0000 +++ b/src/blockinput.h Sun Mar 06 15:59:44 2005 +0000 @@ -94,7 +94,30 @@ } \ while (0) -#define TOTALLY_UNBLOCK_INPUT (interrupt_input_blocked = 0) +/* Undo any number of BLOCK_INPUT calls, + and also reinvoke any pending signal. */ + +#define TOTALLY_UNBLOCK_INPUT \ + if (interrupt_input_blocked != 0) \ + { \ + interrupt_input_blocked = 1; \ + UNBLOCK_INPUT; \ + } \ + else + +/* Undo any number of BLOCK_INPUT calls down to level LEVEL, + and also (if the level is now 0) reinvoke any pending signal. */ + +#define UNBLOCK_INPUT_TO(LEVEL) \ + do \ + { \ + int oldlevel = interrupt_input_blocked; \ + interrupt_input_blocked = (LEVEL) + 1; \ + if (interrupt_input_blocked != oldlevel + 1) \ + UNBLOCK_INPUT; \ + } \ + while (0) + #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT /* In critical section ? */