From 0c156ed6f90bdb97846e691ccfcf405851180c8f Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 10 Mar 2023 20:55:20 -0800 Subject: [PATCH] Context: Switch over to deferred signals --- External/FEXCore/Source/Interface/Context/Context.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); }