My application hitting the race condition regulary was a QtQuick 2.0 application with custom C++ code for window resize and move controlling for a frameless window.
Race condition happened while Qt was using xcb to read event and request window position movements from two threads. Same time rendering thread was drawing scene with opengl. Opengl driver (mesa) is using Xlib for buffer management. Result is assert failure in libxcb in different threads. Same issue is described in
Simple fix is to make sure that Qt calls XInitThreads before opening X11 connections. Too bad application could open X11 connection before calling Qt. In that case it should be application doing calling XInitThreads. But IMO Qt has to do the call for most applications because any Qt application using OpenGL rendering has this race condition currently.