aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1996-01-24 23:43:22 +0000
committerKarl Heuer1996-01-24 23:43:22 +0000
commit31e3a04632f788917de17e67f03c1fdc1f368c02 (patch)
tree565a94d1336993f20d675798c46973abe9e3d58f /src
parentc3f270649dad15bad0413c7c484c8133acb03058 (diff)
downloademacs-31e3a04632f788917de17e67f03c1fdc1f368c02.tar.gz
emacs-31e3a04632f788917de17e67f03c1fdc1f368c02.zip
(x_connection_signal): Explicitly check the thread interlock
on Solaris. [SOLARIS2]: Include Xlibint.h. (x_connection_signal): Access XlibDisplayWriting properly. No need to sleep--if the flag is set, assume connection is dead.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c
index c4798f6b0ff..a3694198739 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -110,6 +110,11 @@ extern void _XEditResCheckMessages ();
110#include <locale.h> 110#include <locale.h>
111#endif 111#endif
112 112
113#ifdef SOLARIS2
114/* For XlibDisplayWriting */
115#include <X11/Xlibint.h>
116#endif
117
113#define min(a,b) ((a)<(b) ? (a) : (b)) 118#define min(a,b) ((a)<(b) ? (a) : (b))
114#define max(a,b) ((a)>(b) ? (a) : (b)) 119#define max(a,b) ((a)>(b) ? (a) : (b))
115 120
@@ -4632,15 +4637,18 @@ x_connection_signal (signalnum) /* If we don't have an argument, */
4632 signal (SIGPIPE, x_connection_signal_1); 4637 signal (SIGPIPE, x_connection_signal_1);
4633 signal (SIGALRM, x_connection_signal_1); 4638 signal (SIGALRM, x_connection_signal_1);
4634 4639
4635 /* According to Jim Campbell <jec@murzim.ca.boeing.com>, 4640#ifdef SOLARIS2
4636 On Solaris 2.4, XNoOp can hang when the connection 4641#ifdef XlibDisplayWriting
4637 has already died. Since XNoOp should not wait, 4642 /* If the thread-interlock is locked, assume this connection is dead.
4638 let's assume that if it hangs for 3 seconds 4643 This assumes that the library does not make other threads
4639 that means the connection is dead. 4644 that can be locking the display legitimately. */
4640 This is a kludge, but I don't see any other way that works. */ 4645 if (x_connection_signal_dpyinfo->display->flags & XlibDisplayWriting)
4641 alarm (3); 4646 x_connection_closed (x_connection_signal_dpyinfo,
4647 "connection was lost");
4648#endif
4649#endif
4650
4642 XNoOp (x_connection_signal_dpyinfo->display); 4651 XNoOp (x_connection_signal_dpyinfo->display);
4643 alarm (0);
4644 4652
4645 XSync (x_connection_signal_dpyinfo->display, False); 4653 XSync (x_connection_signal_dpyinfo->display, False);
4646 4654