]> git.eshelyaron.com Git - emacs.git/commitdiff
Initialize thread support for Xlib.
authorKen Raeburn <raeburn@raeburn.org>
Fri, 30 Dec 2016 01:56:31 +0000 (20:56 -0500)
committerKen Raeburn <raeburn@raeburn.org>
Fri, 30 Dec 2016 22:39:23 +0000 (17:39 -0500)
* src/xterm.c (x_initialize) [THREADS_ENABLED]: Call XInitThreads
before doing anything else with X.

src/xterm.c

index bdc21e6de02b910dfa5b338d9dbbb92c49899342..67bd13a042f77e414eb32848c7a42b0603d4f599 100644 (file)
@@ -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 ();