mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: call XInitThreads at init
X11 isn't thread safe by default. It make sense in 1990 but it is ugly nowadays. The trick is that is must called before any X11 function. So the only safe place is at the start of the main. Pcsx2App::OnInit() is the sooner that I've found.
This commit is contained in:
parent
201c9cd2a4
commit
99180f5afb
|
@ -662,6 +662,7 @@ set(pcsx2FinalLibs
|
|||
${ZLIB_LIBRARIES}
|
||||
${AIO_LIBRARIES}
|
||||
${GCOV_LIBRARIES}
|
||||
${X11_LIBRARIES}
|
||||
)
|
||||
|
||||
if(BUILTIN_GS)
|
||||
|
|
|
@ -424,8 +424,20 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
#ifdef __unix__
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
bool Pcsx2App::OnInit()
|
||||
{
|
||||
#ifdef __unix__
|
||||
// By default X11 isn't thread safe
|
||||
// Typically it avoid a crash on Mesa when glthread is enabled on DRI2
|
||||
//
|
||||
// I guess it could be removed once we migrate to Wayland (post 2020)
|
||||
XInitThreads();
|
||||
#endif
|
||||
|
||||
EnableAllLogging();
|
||||
Console.WriteLn("Interface is initializing. Entering Pcsx2App::OnInit!");
|
||||
|
||||
|
|
Loading…
Reference in New Issue