diff --git a/common/include/Utilities/Threading.h b/common/include/Utilities/Threading.h index b50fa2e2d8..6fa4de885d 100644 --- a/common/include/Utilities/Threading.h +++ b/common/include/Utilities/Threading.h @@ -402,15 +402,11 @@ namespace Threading // Note that the isLockedBool should only be used as an indicator for the locked status, // and not actually depended on for thread synchronization... - struct ScopedLockBool { + struct ScopedLockBool { ScopedLock m_lock; - volatile __aligned(4) bool& m_bool; + std::atomic& m_bool; -#ifdef __linux__ - ScopedLockBool(Mutex& mutexToLock, volatile bool& isLockedBool) -#else - ScopedLockBool(Mutex& mutexToLock, volatile __aligned(4) bool& isLockedBool) -#endif + ScopedLockBool(Mutex& mutexToLock, std::atomic& isLockedBool) : m_lock(mutexToLock), m_bool(isLockedBool) { m_bool = m_lock.IsLocked(); diff --git a/pcsx2/MTVU.h b/pcsx2/MTVU.h index 1a9bab8254..29cc1fcf36 100644 --- a/pcsx2/MTVU.h +++ b/pcsx2/MTVU.h @@ -31,7 +31,7 @@ class VU_Thread : public pxThread { static const u32 buffer_mask = buffer_size - 1; __aligned(4) u32 buffer[buffer_size]; __aligned(4) std::atomic read_pos; // Only modified by VU thread - __aligned(4) volatile bool isBusy; // Is thread processing data? + __aligned(4) std::atomic isBusy; // Is thread processing data? __aligned(4) s32 write_pos; // Only modified by EE thread __aligned(4) s32 write_offset; // Only modified by EE thread __aligned(4) Mutex mtxBusy;