diff options
| author | Paul Eggert | 2012-10-03 22:52:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-10-03 22:52:49 -0700 |
| commit | 88d69b7ddca305bb96d6e671300f6724e4f147dd (patch) | |
| tree | b2ee21fefc1376198029fba154c658c9b2cdf90f | |
| parent | 2b794d6940aa7dc58e297b3649b7799190d71f64 (diff) | |
| download | emacs-88d69b7ddca305bb96d6e671300f6724e4f147dd.tar.gz emacs-88d69b7ddca305bb96d6e671300f6724e4f147dd.zip | |
* profiler.c (handle_profiler_signal): Inhibit pending signals too,
to avoid similar races.
* keyboard.c (pending_signals): Now bool, not int.
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/keyboard.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/profiler.c | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ced0e057e27..744376b0efd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-10-04 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * profiler.c (handle_profiler_signal): Inhibit pending signals too, | ||
| 4 | to avoid similar races. | ||
| 5 | * keyboard.c (pending_signals): Now bool, not int. | ||
| 6 | |||
| 1 | 2012-10-02 Paul Eggert <eggert@cs.ucla.edu> | 7 | 2012-10-02 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 8 | ||
| 3 | * profiler.c (handle_profiler_signal): Fix a malloc race | 9 | * profiler.c (handle_profiler_signal): Fix a malloc race |
diff --git a/src/keyboard.c b/src/keyboard.c index 10dca010fb5..19ece4a22f1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -76,9 +76,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 76 | /* Positive if interrupt input is blocked right now. */ | 76 | /* Positive if interrupt input is blocked right now. */ |
| 77 | volatile int interrupt_input_blocked; | 77 | volatile int interrupt_input_blocked; |
| 78 | 78 | ||
| 79 | /* Nonzero means an input interrupt or alarm signal has arrived. | 79 | /* True means an input interrupt or alarm signal has arrived. |
| 80 | The QUIT macro checks this. */ | 80 | The QUIT macro checks this. */ |
| 81 | volatile int pending_signals; | 81 | volatile bool pending_signals; |
| 82 | 82 | ||
| 83 | #define KBD_BUFFER_SIZE 4096 | 83 | #define KBD_BUFFER_SIZE 4096 |
| 84 | 84 | ||
diff --git a/src/lisp.h b/src/lisp.h index c3cabe0af29..2a647e593a8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2131,7 +2131,7 @@ extern char *stack_bottom; | |||
| 2131 | a request to exit Emacs when it is safe to do. */ | 2131 | a request to exit Emacs when it is safe to do. */ |
| 2132 | 2132 | ||
| 2133 | extern void process_pending_signals (void); | 2133 | extern void process_pending_signals (void); |
| 2134 | extern int volatile pending_signals; | 2134 | extern bool volatile pending_signals; |
| 2135 | 2135 | ||
| 2136 | extern void process_quit_flag (void); | 2136 | extern void process_quit_flag (void); |
| 2137 | #define QUIT \ | 2137 | #define QUIT \ |
diff --git a/src/profiler.c b/src/profiler.c index 461aae3e09f..51580710f28 100644 --- a/src/profiler.c +++ b/src/profiler.c | |||
| @@ -239,6 +239,7 @@ handle_profiler_signal (int signal) | |||
| 239 | else | 239 | else |
| 240 | { | 240 | { |
| 241 | Lisp_Object oquit; | 241 | Lisp_Object oquit; |
| 242 | bool saved_pending_signals; | ||
| 242 | EMACS_INT count = 1; | 243 | EMACS_INT count = 1; |
| 243 | #ifdef HAVE_ITIMERSPEC | 244 | #ifdef HAVE_ITIMERSPEC |
| 244 | if (profiler_timer_ok) | 245 | if (profiler_timer_ok) |
| @@ -252,12 +253,15 @@ handle_profiler_signal (int signal) | |||
| 252 | uses QUIT, which can call malloc, which can cause disaster in | 253 | uses QUIT, which can call malloc, which can cause disaster in |
| 253 | a signal handler. So inhibit QUIT. */ | 254 | a signal handler. So inhibit QUIT. */ |
| 254 | oquit = Vinhibit_quit; | 255 | oquit = Vinhibit_quit; |
| 256 | saved_pending_signals = pending_signals; | ||
| 255 | Vinhibit_quit = Qt; | 257 | Vinhibit_quit = Qt; |
| 258 | pending_signals = 0; | ||
| 256 | 259 | ||
| 257 | eassert (HASH_TABLE_P (cpu_log)); | 260 | eassert (HASH_TABLE_P (cpu_log)); |
| 258 | record_backtrace (XHASH_TABLE (cpu_log), count); | 261 | record_backtrace (XHASH_TABLE (cpu_log), count); |
| 259 | 262 | ||
| 260 | Vinhibit_quit = oquit; | 263 | Vinhibit_quit = oquit; |
| 264 | pending_signals = saved_pending_signals; | ||
| 261 | } | 265 | } |
| 262 | } | 266 | } |
| 263 | 267 | ||