bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#12471: Avoid some signal-handling races, and simplify.


From: Paul Eggert
Subject: bug#12471: Avoid some signal-handling races, and simplify.
Date: Fri, 21 Sep 2012 11:13:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/21/2012 10:38 AM, Eli Zaretskii wrote:
> I see no way to do that in any place but where 'raise' is called,
> sorry.

Well I'm no Windows expert, but if I understand things correctly,
the following should do the trick, since it uses the same
pattern that the Windows code already uses for
'kill', 'signal', and 'sigaction'.  This approach should avoid
the macro problems that my earlier suggestion had.

=== modified file 'nt/ChangeLog'
--- nt/ChangeLog        2012-09-18 10:49:33 +0000
+++ nt/ChangeLog        2012-09-21 18:10:25 +0000
@@ -1,3 +1,7 @@
+2012-09-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * inc/ms-w32.h (raise): New macro.
+
 2012-09-18  Eli Zaretskii  <eliz@gnu.org>
 
        * configure.bat: Include stddef.h before gif_lib.h, to have size_t

=== modified file 'nt/inc/ms-w32.h'
--- nt/inc/ms-w32.h     2012-09-07 08:20:07 +0000
+++ nt/inc/ms-w32.h     2012-09-21 18:10:25 +0000
@@ -200,6 +200,7 @@
 /* Subprocess calls that are emulated.  */
 #define spawnve sys_spawnve
 #define wait    sys_wait
+#define raise   sys_raise
 #define kill    sys_kill
 #define signal  sys_signal
 

=== modified file 'src/ChangeLog'
--- src/ChangeLog       2012-09-21 07:21:06 +0000
+++ src/ChangeLog       2012-09-21 18:10:25 +0000
@@ -124,6 +124,7 @@
        (emacs_backtrace): Output backtrace for the appropriate thread,
        which is not necessarily the main thread.
        * syssignal.h: Include <stdbool.h>.
+       * w32proc.c (sys_raise): New function.
        * xterm.c (x_connection_signal): Remove; no longer needed
        now that we use sigaction.
        (x_connection_closed): No need to mess with sigmask now.

=== modified file 'src/w32proc.c'
--- src/w32proc.c       2012-09-15 08:03:11 +0000
+++ src/w32proc.c       2012-09-21 18:10:25 +0000
@@ -1421,6 +1421,12 @@
 }
 
 int
+sys_raise (int sig)
+{
+  sys_kill (getpid (), sig);
+}
+
+int
 sys_kill (int pid, int sig)
 {
   child_process *cp;







reply via email to

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