From: Chad Versace Date: Tue, 27 Dec 2016 21:47:33 +0000 (-0800) Subject: x11: Call XInitThreads() X-Git-Tag: upstream/0.1.0~445^2~52^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d11c9d2c03deb72ecca1a948ba369bbedfb9b21;p=platform%2Fupstream%2FVK-GL-CTS.git 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. 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 --- diff --git a/framework/platform/X11/tcuX11Platform.cpp b/framework/platform/X11/tcuX11Platform.cpp index a34dcdf..eb00635 100644 --- a/framework/platform/X11/tcuX11Platform.cpp +++ b/framework/platform/X11/tcuX11Platform.cpp @@ -144,5 +144,13 @@ X11Platform::X11Platform (void) 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(); }