# HG changeset patch # User Karl Heuer # Date 822527002 0 # Node ID 3cc44eaf9ebf82a6e5f05bbfaf6bb36169b88297 # Parent 57194b6a555dcc2ba18065d8a775244b935d7466 (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. diff -r 57194b6a555d -r 3cc44eaf9ebf src/xterm.c --- a/src/xterm.c Wed Jan 24 23:42:32 1996 +0000 +++ b/src/xterm.c Wed Jan 24 23:43:22 1996 +0000 @@ -110,6 +110,11 @@ #include #endif +#ifdef SOLARIS2 +/* For XlibDisplayWriting */ +#include +#endif + #define min(a,b) ((a)<(b) ? (a) : (b)) #define max(a,b) ((a)>(b) ? (a) : (b)) @@ -4632,15 +4637,18 @@ signal (SIGPIPE, x_connection_signal_1); signal (SIGALRM, x_connection_signal_1); - /* According to Jim Campbell , - On Solaris 2.4, XNoOp can hang when the connection - has already died. Since XNoOp should not wait, - let's assume that if it hangs for 3 seconds - that means the connection is dead. - This is a kludge, but I don't see any other way that works. */ - alarm (3); +#ifdef SOLARIS2 +#ifdef XlibDisplayWriting + /* If the thread-interlock is locked, assume this connection is dead. + This assumes that the library does not make other threads + that can be locking the display legitimately. */ + if (x_connection_signal_dpyinfo->display->flags & XlibDisplayWriting) + x_connection_closed (x_connection_signal_dpyinfo, + "connection was lost"); +#endif +#endif + XNoOp (x_connection_signal_dpyinfo->display); - alarm (0); XSync (x_connection_signal_dpyinfo->display, False);