x11: Call XInitThreads()
authorChad Versace <chadversary@google.com>
Mon, 13 Nov 2017 11:02:02 +0000 (13:02 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 13 Nov 2017 11:12:19 +0000 (13:12 +0200)
commita8bd356e5802e8ca33bd847e7f403d8d9c1e7ed4
tree2d7440669bbf04f428355b278bc963fd9eb36b24
parentecb9e37545ef7499f7385eab6a912035234ec0c6
x11: Call XInitThreads()

Because the X11 manual says we must.

From man:XInitThreads(3):

  The XInitThreads function initializes Xlib support for concurrent
  threads.  This function must be the first Xlib function
  a multi-threaded program calls, and it must complete before any other
  Xlib call is made.

(See also Vulkan spec section "Xlib Platform")

Fixes crash in multithreaded test:

  Test case 'dEQP-EGL.functional.multithread.window'..
  [xcb] Unknown request in queue while dequeuing
  [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
  [xcb] Aborting, sorry about that.
  deqp-egl: xcb_io.c:165: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
  Aborted (core dumped)

Change-Id: I2124be592a8d2d9036423cc2f0d71066e0e22939
framework/platform/lnx/X11/tcuLnxX11.cpp