[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/emacs.c
From: |
Jan Djärv |
Subject: |
[Emacs-diffs] Changes to emacs/src/emacs.c |
Date: |
Wed, 15 Dec 2004 18:51:47 -0500 |
Index: emacs/src/emacs.c
diff -c emacs/src/emacs.c:1.352 emacs/src/emacs.c:1.353
*** emacs/src/emacs.c:1.352 Sat Dec 11 21:53:33 2004
--- emacs/src/emacs.c Wed Dec 15 21:40:39 2004
***************
*** 342,347 ****
--- 342,355 ----
void (*fatal_error_signal_hook) P_ ((void));
+ #ifdef HAVE_GTK_AND_PTHREAD
+ /* When compiled with GTK and running under Gnome, multiple threads meay be
+ created. Keep track of our main thread to make sure signals are delivered
+ to it (see syssignal.h). */
+
+ pthread_t main_thread;
+ #endif
+
#ifdef SIGUSR1
SIGTYPE
***************
*** 350,355 ****
--- 358,364 ----
{
struct input_event buf;
+ SIGNAL_THREAD_CHECK (sig);
bzero (&buf, sizeof buf);
buf.kind = USER_SIGNAL_EVENT;
buf.frame_or_window = selected_frame;
***************
*** 365,370 ****
--- 374,380 ----
{
struct input_event buf;
+ SIGNAL_THREAD_CHECK (sig);
bzero (&buf, sizeof buf);
buf.kind = USER_SIGNAL_EVENT;
buf.code = 1;
***************
*** 379,384 ****
--- 389,395 ----
fatal_error_signal (sig)
int sig;
{
+ SIGNAL_THREAD_CHECK (sig);
fatal_error_code = sig;
signal (sig, SIG_DFL);
***************
*** 418,423 ****
--- 429,435 ----
int sig;
{
signal (sig, memory_warning_signal);
+ SIGNAL_THREAD_CHECK (sig);
malloc_warning ("Operating system warns that virtual memory is running
low.\n");
***************
*** 1029,1034 ****
--- 1041,1050 ----
# endif /* not SYNC_INPUT */
#endif /* not SYSTEM_MALLOC */
+ #ifdef HAVE_GTK_AND_PTHREAD
+ main_thread = pthread_self ();
+ #endif /* HAVE_GTK_AND_PTHREAD */
+
#if defined (MSDOS) || defined (WINDOWSNT)
/* We do all file input/output as binary files. When we need to translate
newlines, we do that manually. */