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.
Fixes crash in multithreaded test:
Test case 'dEQP-EGL.functional.multithread.window_context'..
[xcb] Unknown sequence number while processing queue
[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:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Change-Id: Ib3b535cec8295e062994fd759ae083c78641cf13
tcu::Platform* createPlatform (void)
{
+ // 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.
+ DE_CHECK_RUNTIME_ERR(XInitThreads() != 0);
+
return new tcu::x11::X11Platform();
}