From 0a1ecdf6ae9e56bff6c3fb3ed411d00511611e1a Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 8 Dec 2024 08:01:28 -0800 Subject: [PATCH] FEXCore: Don't `WaitForEmptyJobQueue` if CodeObjectCacheService isn't used Seems the unused mutex locking is able to cause some hangs according to #4198 Hard to tell why, but might as well as get rid of that potential pitfall. --- FEXCore/Source/Interface/Core/Core.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FEXCore/Source/Interface/Core/Core.cpp b/FEXCore/Source/Interface/Core/Core.cpp index a5d7ccc996..a4fe29706b 100644 --- a/FEXCore/Source/Interface/Core/Core.cpp +++ b/FEXCore/Source/Interface/Core/Core.cpp @@ -366,7 +366,7 @@ void ContextImpl::HandleCallback(FEXCore::Core::InternalThreadState* Thread, uin void ContextImpl::ExecuteThread(FEXCore::Core::InternalThreadState* Thread) { Dispatcher->ExecuteDispatch(Thread->CurrentFrame); - { + if (CodeObjectCacheService) { // Ensure the Code Object Serialization service has fully serialized this thread's data before clearing the cache // Use the thread's object cache ref counter for this CodeSerialize::CodeObjectSerializeService::WaitForEmptyJobQueue(&Thread->ObjectCacheRefCounter); @@ -469,7 +469,7 @@ void ContextImpl::AddBlockMapping(FEXCore::Core::InternalThreadState* Thread, ui void ContextImpl::ClearCodeCache(FEXCore::Core::InternalThreadState* Thread) { FEXCORE_PROFILE_INSTANT("ClearCodeCache"); - { + if (CodeObjectCacheService) { // Ensure the Code Object Serialization service has fully serialized this thread's data before clearing the cache // Use the thread's object cache ref counter for this CodeSerialize::CodeObjectSerializeService::WaitForEmptyJobQueue(&Thread->ObjectCacheRefCounter);