Commit 88d69b7d authored by Paul Eggert's avatar Paul Eggert

* profiler.c (handle_profiler_signal): Inhibit pending signals too,

to avoid similar races.
* keyboard.c (pending_signals): Now bool, not int.
parent 2b794d69
2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
* profiler.c (handle_profiler_signal): Inhibit pending signals too,
to avoid similar races.
* keyboard.c (pending_signals): Now bool, not int.
2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
* profiler.c (handle_profiler_signal): Fix a malloc race
......
......@@ -76,9 +76,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Positive if interrupt input is blocked right now. */
volatile int interrupt_input_blocked;
/* Nonzero means an input interrupt or alarm signal has arrived.
/* True means an input interrupt or alarm signal has arrived.
The QUIT macro checks this. */
volatile int pending_signals;
volatile bool pending_signals;
#define KBD_BUFFER_SIZE 4096
......
......@@ -2131,7 +2131,7 @@ extern char *stack_bottom;
a request to exit Emacs when it is safe to do. */
extern void process_pending_signals (void);
extern int volatile pending_signals;
extern bool volatile pending_signals;
extern void process_quit_flag (void);
#define QUIT \
......
......@@ -239,6 +239,7 @@ handle_profiler_signal (int signal)
else
{
Lisp_Object oquit;
bool saved_pending_signals;
EMACS_INT count = 1;
#ifdef HAVE_ITIMERSPEC
if (profiler_timer_ok)
......@@ -252,12 +253,15 @@ handle_profiler_signal (int signal)
uses QUIT, which can call malloc, which can cause disaster in
a signal handler. So inhibit QUIT. */
oquit = Vinhibit_quit;
saved_pending_signals = pending_signals;
Vinhibit_quit = Qt;
pending_signals = 0;
eassert (HASH_TABLE_P (cpu_log));
record_backtrace (XHASH_TABLE (cpu_log), count);
Vinhibit_quit = oquit;
pending_signals = saved_pending_signals;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment