aboutsummaryrefslogtreecommitdiff
path: root/externals/microprofile/microprofile.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-08-26 02:22:34 +0000
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-08-26 02:47:54 +0000
commit3dcaaa18be1cf60bd0447f1dff6e4fa1ad175cf9 (patch)
tree7ac29da5e89af8241fa0ed46a02353f28ab44028 /externals/microprofile/microprofile.h
parent4efaecf1251b152536cbf84af2616f3181d64960 (diff)
externals/microprofile: Fix data race in g_bUseLock
As reported by tsan, g_bUseLock had a data race. Fix this using an atomic boolean.
Diffstat (limited to 'externals/microprofile/microprofile.h')
-rw-r--r--externals/microprofile/microprofile.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h
index 6dae65a66f..85d5bd5dec 100644
--- a/externals/microprofile/microprofile.h
+++ b/externals/microprofile/microprofile.h
@@ -1037,7 +1037,7 @@ static void MicroProfileCreateThreadLogKey()
#else
MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0;
#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);