aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorJan Djärv2004-12-15 21:40:41 +0000
committerJan Djärv2004-12-15 21:40:41 +0000
commit333f1b6f78ea3923fd49c8bb7f4d4aef39549591 (patch)
tree9f8044dff23e460bb11e8aa324cec148e1ca89b0 /src/keyboard.c
parentfecad3f6597e12724d2329354905a99450347d0c (diff)
downloademacs-333f1b6f78ea3923fd49c8bb7f4d4aef39549591.tar.gz
emacs-333f1b6f78ea3923fd49c8bb7f4d4aef39549591.zip
* syssignal.h: Declare main_thread.
(SIGNAL_THREAD_CHECK): New macro. * keyboard.c (input_available_signal): Move thread checking code to macro SIGNAL_THREAD_CHECK and call that macro. (interrupt_signal): Call SIGNAL_THREAD_CHECK. * alloc.c (uninterrupt_malloc): Move main_thread to emacs.c. * emacs.c: Define main_thread. (main): Initialize main_thread. (handle_USR1_signal, handle_USR2_signal, fatal_error_signal) (memory_warning_signal): Call SIGNAL_THREAD_CHECK. * floatfns.c (float_error): Call SIGNAL_THREAD_CHECK. * dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK. * sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK. * process.c (send_process_trap, sigchld_handler): Call SIGNAL_THREAD_CHECK. * data.c (arith_error): Call SIGNAL_THREAD_CHECK. * atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 95de9c2c6ad..ffd36acb335 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6838,23 +6838,7 @@ input_available_signal (signo)
6838 interrupt_input_pending = 1; 6838 interrupt_input_pending = 1;
6839#else 6839#else
6840 6840
6841# if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) 6841 SIGNAL_THREAD_CHECK (signo);
6842 extern pthread_t main_thread;
6843 if (pthread_self () != main_thread)
6844 {
6845 /* POSIX says any thread can receive the signal. On GNU/Linux that is
6846 not true, but for other systems (FreeBSD at least) it is. So direct
6847 the signal to the correct thread and block it from this thread. */
6848 sigset_t new_mask;
6849
6850 sigemptyset (&new_mask);
6851 sigaddset (&new_mask, SIGIO);
6852 pthread_sigmask (SIG_BLOCK, &new_mask, 0);
6853 pthread_kill (main_thread, SIGIO);
6854 return;
6855 }
6856# endif /* HAVE_GTK_AND_PTHREAD */
6857
6858 handle_async_input (); 6842 handle_async_input ();
6859#endif 6843#endif
6860 6844
@@ -10270,6 +10254,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
10270 } 10254 }
10271#endif /* USG */ 10255#endif /* USG */
10272 10256
10257 SIGNAL_THREAD_CHECK (signalnum);
10273 cancel_echoing (); 10258 cancel_echoing ();
10274 10259
10275 if (!NILP (Vquit_flag) 10260 if (!NILP (Vquit_flag)