emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110355: * profiler.c (handle_profile


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110355: * profiler.c (handle_profiler_signal): Inhibit pending signals too,
Date: Wed, 03 Oct 2012 22:52:49 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110355
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2012-10-03 22:52:49 -0700
message:
  * profiler.c (handle_profiler_signal): Inhibit pending signals too,
  
  to avoid similar races.
  * keyboard.c (pending_signals): Now bool, not int.
modified:
  src/ChangeLog
  src/keyboard.c
  src/lisp.h
  src/profiler.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-10-02 19:38:10 +0000
+++ b/src/ChangeLog     2012-10-04 05:52:49 +0000
@@ -1,3 +1,9 @@
+2012-10-04  Paul Eggert  <address@hidden>
+
+       * 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  <address@hidden>
 
        * profiler.c (handle_profiler_signal): Fix a malloc race

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-10-01 06:36:54 +0000
+++ b/src/keyboard.c    2012-10-04 05:52:49 +0000
@@ -76,9 +76,9 @@
 /* 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
 

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-10-01 02:07:14 +0000
+++ b/src/lisp.h        2012-10-04 05:52:49 +0000
@@ -2131,7 +2131,7 @@
    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                                           \

=== modified file 'src/profiler.c'
--- a/src/profiler.c    2012-10-04 00:10:47 +0000
+++ b/src/profiler.c    2012-10-04 05:52:49 +0000
@@ -239,6 +239,7 @@
   else
     {
       Lisp_Object oquit;
+      bool saved_pending_signals;
       EMACS_INT count = 1;
 #ifdef HAVE_ITIMERSPEC
       if (profiler_timer_ok)
@@ -252,12 +253,15 @@
         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;
     }
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]