/[emacs]/emacs/src/keyboard.c
ViewVC logotype

Diff of /emacs/src/keyboard.c

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

revision 1.800 by jhd, Tue Dec 7 21:03:03 2004 UTC revision 1.801 by monnier, Sat Dec 11 23:43:21 2004 UTC
# Line 6780  handle_async_input () Line 6780  handle_async_input ()
6780  #ifdef BSD4_1  #ifdef BSD4_1
6781    extern int select_alarmed;    extern int select_alarmed;
6782  #endif  #endif
 #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)  
   extern pthread_t main_thread;  
   if (pthread_self () != main_thread)  
     {  
       /* POSIX says any thread can receive the signal.  On GNU/Linux that is  
          not true, but for other systems (FreeBSD at least) it is.  So direct  
          the signal to the correct thread and block it from this thread.  */  
 #ifdef SIGIO  
       sigset_t new_mask;  
   
       sigemptyset (&new_mask);  
       sigaddset (&new_mask, SIGIO);  
       pthread_sigmask (SIG_BLOCK, &new_mask, 0);  
       pthread_kill (main_thread, SIGIO);  
 #endif  
       return;  
     }  
 #endif  
6783    
6784    interrupt_input_pending = 0;    interrupt_input_pending = 0;
6785    
# Line 6826  input_available_signal (signo) Line 6808  input_available_signal (signo)
6808  {  {
6809    /* Must preserve main program's value of errno.  */    /* Must preserve main program's value of errno.  */
6810    int old_errno = errno;    int old_errno = errno;
 #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)  
   extern pthread_t main_thread;  
   if (pthread_self () != main_thread)  
     {  
       /* POSIX says any thread can receive the signal.  On GNU/Linux that is  
          not true, but for other systems (FreeBSD at least) it is.  So direct  
          the signal to the correct thread and block it from this thread.  */  
       sigset_t new_mask;  
   
       sigemptyset (&new_mask);  
       sigaddset (&new_mask, SIGIO);  
       pthread_sigmask (SIG_BLOCK, &new_mask, 0);  
       pthread_kill (main_thread, SIGIO);  
       return;  
     }  
 #endif /* HAVE_GTK_AND_PTHREAD */  
6811  #if defined (USG) && !defined (POSIX_SIGNALS)  #if defined (USG) && !defined (POSIX_SIGNALS)
6812    /* USG systems forget handlers when they are used;    /* USG systems forget handlers when they are used;
6813       must reestablish each time */       must reestablish each time */
# Line 6858  input_available_signal (signo) Line 6824  input_available_signal (signo)
6824  #ifdef SYNC_INPUT  #ifdef SYNC_INPUT
6825    interrupt_input_pending = 1;    interrupt_input_pending = 1;
6826  #else  #else
6827    
6828    # if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
6829      extern pthread_t main_thread;
6830      if (pthread_self () != main_thread)
6831        {
6832          /* POSIX says any thread can receive the signal.  On GNU/Linux that is
6833             not true, but for other systems (FreeBSD at least) it is.  So direct
6834             the signal to the correct thread and block it from this thread.  */
6835          sigset_t new_mask;
6836    
6837          sigemptyset (&new_mask);
6838          sigaddset (&new_mask, SIGIO);
6839          pthread_sigmask (SIG_BLOCK, &new_mask, 0);
6840          pthread_kill (main_thread, SIGIO);
6841          return;
6842        }
6843    # endif /* HAVE_GTK_AND_PTHREAD */
6844    
6845    handle_async_input ();    handle_async_input ();
6846  #endif  #endif
6847    

Legend:
Removed from v.1.800  
changed lines
  Added in v.1.801

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