diff --git a/External/FEXCore/Source/Interface/Context/Context.h b/External/FEXCore/Source/Interface/Context/Context.h index 909b966dc..585ce4786 100644 --- a/External/FEXCore/Source/Interface/Context/Context.h +++ b/External/FEXCore/Source/Interface/Context/Context.h @@ -1,7 +1,6 @@ #pragma once #include "Common/JitSymbols.h" -#include "FEXHeaderUtils/ScopedSignalMask.h" #include "Interface/Core/CPUID.h" #include "Interface/Core/X86HelperGen.h" #include "Interface/Core/ObjectCache/ObjectCacheService.h" @@ -14,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -290,7 +290,8 @@ namespace FEXCore::Context { template static uint64_t ThreadExitFunctionLink(FEXCore::Core::CpuStateFrame *Frame, uint64_t *record) { - FHU::ScopedSignalMaskWithSharedLock lk(static_cast(Frame->Thread->CTX)->CodeInvalidationMutex); + auto Thread = Frame->Thread; + ScopedDeferredSignalWithSharedLock lk(static_cast(Thread->CTX)->CodeInvalidationMutex, Thread); return Fn(Frame, record); } @@ -302,7 +303,7 @@ namespace FEXCore::Context { LogMan::Throw::AFmt(Thread->ThreadManager.GetTID() == FHU::Syscalls::gettid(), "Must be called from owning thread {}, not {}", Thread->ThreadManager.GetTID(), FHU::Syscalls::gettid()); - FHU::ScopedSignalMaskWithUniqueLock lk(static_cast(Thread->CTX)->CodeInvalidationMutex); + ScopedDeferredSignalWithUniqueLock lk(static_cast(Thread->CTX)->CodeInvalidationMutex, Thread); ThreadRemoveCodeEntry(Thread, GuestRIP); }