comparison src/keyboard.c @ 90066:fb79180b618d

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-78 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-719 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-732 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-733 Update from CVS: man/calc.texi: Fix some TeX definitions. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-75 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-76 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77 Update from CVS
author Miles Bader <miles@gnu.org>
date Tue, 14 Dec 2004 07:34:55 +0000
parents f2ebccfa87d4 cf6107ab7096
children eac554634bfa
comparison
equal deleted inserted replaced
90065:c26eb15cd14a 90066:fb79180b618d
6777 handle_async_input () 6777 handle_async_input ()
6778 { 6778 {
6779 #ifdef BSD4_1 6779 #ifdef BSD4_1
6780 extern int select_alarmed; 6780 extern int select_alarmed;
6781 #endif 6781 #endif
6782 #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
6783 extern pthread_t main_thread;
6784 if (pthread_self () != main_thread)
6785 {
6786 /* POSIX says any thread can receive the signal. On GNU/Linux that is
6787 not true, but for other systems (FreeBSD at least) it is. So direct
6788 the signal to the correct thread and block it from this thread. */
6789 #ifdef SIGIO
6790 sigset_t new_mask;
6791
6792 sigemptyset (&new_mask);
6793 sigaddset (&new_mask, SIGIO);
6794 pthread_sigmask (SIG_BLOCK, &new_mask, 0);
6795 pthread_kill (main_thread, SIGIO);
6796 #endif
6797 return;
6798 }
6799 #endif
6800 6782
6801 interrupt_input_pending = 0; 6783 interrupt_input_pending = 0;
6802 6784
6803 while (1) 6785 while (1)
6804 { 6786 {
6823 input_available_signal (signo) 6805 input_available_signal (signo)
6824 int signo; 6806 int signo;
6825 { 6807 {
6826 /* Must preserve main program's value of errno. */ 6808 /* Must preserve main program's value of errno. */
6827 int old_errno = errno; 6809 int old_errno = errno;
6828 #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) 6810 #if defined (USG) && !defined (POSIX_SIGNALS)
6811 /* USG systems forget handlers when they are used;
6812 must reestablish each time */
6813 signal (signo, input_available_signal);
6814 #endif /* USG */
6815
6816 #ifdef BSD4_1
6817 sigisheld (SIGIO);
6818 #endif
6819
6820 if (input_available_clear_time)
6821 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
6822
6823 #ifdef SYNC_INPUT
6824 interrupt_input_pending = 1;
6825 #else
6826
6827 # if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
6829 extern pthread_t main_thread; 6828 extern pthread_t main_thread;
6830 if (pthread_self () != main_thread) 6829 if (pthread_self () != main_thread)
6831 { 6830 {
6832 /* POSIX says any thread can receive the signal. On GNU/Linux that is 6831 /* 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 6832 not true, but for other systems (FreeBSD at least) it is. So direct
6838 sigaddset (&new_mask, SIGIO); 6837 sigaddset (&new_mask, SIGIO);
6839 pthread_sigmask (SIG_BLOCK, &new_mask, 0); 6838 pthread_sigmask (SIG_BLOCK, &new_mask, 0);
6840 pthread_kill (main_thread, SIGIO); 6839 pthread_kill (main_thread, SIGIO);
6841 return; 6840 return;
6842 } 6841 }
6843 #endif /* HAVE_GTK_AND_PTHREAD */ 6842 # endif /* HAVE_GTK_AND_PTHREAD */
6844 #if defined (USG) && !defined (POSIX_SIGNALS) 6843
6845 /* USG systems forget handlers when they are used;
6846 must reestablish each time */
6847 signal (signo, input_available_signal);
6848 #endif /* USG */
6849
6850 #ifdef BSD4_1
6851 sigisheld (SIGIO);
6852 #endif
6853
6854 if (input_available_clear_time)
6855 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
6856
6857 #ifdef SYNC_INPUT
6858 interrupt_input_pending = 1;
6859 #else
6860 handle_async_input (); 6844 handle_async_input ();
6861 #endif 6845 #endif
6862 6846
6863 #ifdef BSD4_1 6847 #ifdef BSD4_1
6864 sigfree (); 6848 sigfree ();