Mercurial > emacs
diff src/keyboard.c @ 90054:f2ebccfa87d4
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-74
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-709
Update from CVS: src/indent.c (Fvertical_motion): Fix last change.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-710
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-715
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-74
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 08 Dec 2004 05:02:30 +0000 |
parents | b637c617432f 9f7c2511d457 |
children | fb79180b618d |
line wrap: on
line diff
--- a/src/keyboard.c Mon Dec 06 12:38:25 2004 +0000 +++ b/src/keyboard.c Wed Dec 08 05:02:30 2004 +0000 @@ -45,6 +45,9 @@ #include <setjmp.h> #include <errno.h> +#ifdef HAVE_GTK_AND_PTHREAD +#include <pthread.h> +#endif #ifdef MSDOS #include "msdos.h" #include <time.h> @@ -607,7 +610,7 @@ /* We are unable to use interrupts if FIONREAD is not available, so flush SIGIO so we won't try. */ -#if !defined (FIONREAD) || defined(HAVE_CARBON) +#if !defined (FIONREAD) #ifdef SIGIO #undef SIGIO #endif @@ -1618,7 +1621,10 @@ if (NILP (Vthis_command)) { /* nil means key is undefined. */ + Lisp_Object keys = Fvector (i, keybuf); + keys = Fkey_description (keys, Qnil); bitch_at_user (); + message_with_string ("%s is undefined", keys, 0); current_kboard->defining_kbd_macro = Qnil; update_mode_lines = 1; current_kboard->Vprefix_arg = Qnil; @@ -6773,6 +6779,25 @@ #ifdef BSD4_1 extern int select_alarmed; #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 + interrupt_input_pending = 0; while (1) @@ -6800,7 +6825,22 @@ { /* Must preserve main program's value of 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 */ #if defined (USG) && !defined (POSIX_SIGNALS) /* USG systems forget handlers when they are used; must reestablish each time */