summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@raeburn.org>2016-12-29 20:56:31 -0500
committerKen Raeburn <raeburn@raeburn.org>2016-12-30 17:39:23 -0500
commitb0239945a36dafae908259a9a29c2a166ff53cee (patch)
tree9d824e99ecaa7a9e1ae5a97518c0fb9b0e7a93d0 /src/xterm.c
parent108ef8033be79e9e5567002e85a316ecb5e77cad (diff)
downloademacs-b0239945a36dafae908259a9a29c2a166ff53cee.tar.gz
Initialize thread support for Xlib.
* src/xterm.c (x_initialize) [THREADS_ENABLED]: Call XInitThreads before doing anything else with X.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index bdc21e6de02..67bd13a042f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12762,6 +12762,13 @@ x_initialize (void)
/* Try to use interrupt input; if we can't, then start polling. */
Fset_input_interrupt_mode (Qt);
+#if THREADS_ENABLED
+ /* This must be called before any other Xlib routines. */
+ if (XInitThreads () == 0)
+ fprintf (stderr,
+ "Warning: An error occurred initializing X11 thread support!\n");
+#endif
+
#ifdef USE_X_TOOLKIT
XtToolkitInitialize ();