diff options
| author | 2020-08-26 02:22:34 +0000 | |
|---|---|---|
| committer | 2020-08-26 02:47:54 +0000 | |
| commit | 3dcaaa18be1cf60bd0447f1dff6e4fa1ad175cf9 (patch) | |
| tree | 7ac29da5e89af8241fa0ed46a02353f28ab44028 /externals/microprofile | |
| parent | Merge pull request #4572 from lioncash/xbyak (diff) | |
| download | yuzu-3dcaaa18be1cf60bd0447f1dff6e4fa1ad175cf9.tar.gz yuzu-3dcaaa18be1cf60bd0447f1dff6e4fa1ad175cf9.tar.xz yuzu-3dcaaa18be1cf60bd0447f1dff6e4fa1ad175cf9.zip | |
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')
| -rw-r--r-- | externals/microprofile/microprofile.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index 6dae65a66..85d5bd5de 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h | |||
| @@ -1037,7 +1037,7 @@ static void MicroProfileCreateThreadLogKey() | |||
| 1037 | #else | 1037 | #else |
| 1038 | MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0; | 1038 | MP_THREAD_LOCAL MicroProfileThreadLog* g_MicroProfileThreadLog = 0; |
| 1039 | #endif | 1039 | #endif |
| 1040 | 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) | 1040 | 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) |
| 1041 | 1041 | ||
| 1042 | 1042 | ||
| 1043 | MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee); | 1043 | MICROPROFILE_DEFINE(g_MicroProfileFlip, "MicroProfile", "MicroProfileFlip", 0x3355ee); |