yuzu-emu
/
yuzu
Archived
1
0
Fork 0

externals/microprofile: Fix data race in g_bUseLock

As reported by tsan, g_bUseLock had a data race. Fix this using an
atomic boolean.
This commit is contained in:
ReinUsesLisp 2020-08-26 02:22:34 +00:00
parent 4efaecf125
commit 3dcaaa18be
1 changed files with 1 additions and 1 deletions

View File

@ -1037,7 +1037,7 @@ static void MicroProfileCreateThreadLogKey()
#else #else
MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0; MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0;
#endif #endif
static bool g_bUseLock = false; /// This is used because windows does not support using mutexes under dll init(which is where global initialization is handled) static std::atomic<bool> g_bUseLock{false}; /// This is used because windows does not support using mutexes under dll init(which is where global initialization is handled)
MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee); MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee);