/[emacs]/emacs/src/syssignal.h
ViewVC logotype

Diff of /emacs/src/syssignal.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by ttn, Sun May 2 16:00:08 2004 UTC revision 1.39 by jhd, Wed Dec 15 21:40:40 2004 UTC
# Line 20  Boston, MA 02111-1307, USA.  */ Line 20  Boston, MA 02111-1307, USA.  */
20    
21  extern void init_signals P_ ((void));  extern void init_signals P_ ((void));
22    
23    #ifdef HAVE_GTK_AND_PTHREAD
24    #include <pthread.h>
25    extern pthread_t main_thread;
26    #endif
27    
28  #ifdef POSIX_SIGNALS  #ifdef POSIX_SIGNALS
29    
30  /* Don't #include <signal.h>.  That header should always be #included  /* Don't #include <signal.h>.  That header should always be #included
# Line 198  extern SIGMASKTYPE sigprocmask_set; Line 203  extern SIGMASKTYPE sigprocmask_set;
203  char *strsignal ();  char *strsignal ();
204  #endif  #endif
205    
206    #ifdef HAVE_GTK_AND_PTHREAD
207    #define SIGNAL_THREAD_CHECK(signo)                                      \
208      do {                                                                  \
209        if (pthread_self () != main_thread)                                 \
210          {                                                                 \
211            /* POSIX says any thread can receive the signal.  On GNU/Linux  \
212               that is not true, but for other systems (FreeBSD at least)   \
213               it is.  So direct the signal to the correct thread and block \
214               it from this thread.  */                                     \
215            sigset_t new_mask;                                              \
216                                                                            \
217            sigemptyset (&new_mask);                                        \
218            sigaddset (&new_mask, signo);                                   \
219            pthread_sigmask (SIG_BLOCK, &new_mask, 0);                      \
220            pthread_kill (main_thread, signo);                              \
221            return;                                                         \
222          }                                                                 \
223       } while (0)
224    
225    #else /* not HAVE_GTK_AND_PTHREAD */
226    #define SIGNAL_THREAD_CHECK(signo)
227    #endif /* not HAVE_GTK_AND_PTHREAD */
228  /* arch-tag: 4580e86a-340d-4574-9e11-a742b6e1a152  /* arch-tag: 4580e86a-340d-4574-9e11-a742b6e1a152
229     (do not change this comment) */     (do not change this comment) */

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26