From 6e8a5f3a5fdd9959ba8370ab78268c771a1c0362 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 10 Aug 2015 20:32:22 +0200 Subject: [PATCH] PPU/LLVM: Avoid recompiler thread spinning forever --- rpcs3/Emu/Cell/PPULLVMRecompiler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp index a048cafe49..0676c8f828 100644 --- a/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/PPULLVMRecompiler.cpp @@ -559,8 +559,13 @@ void RecompilationEngine::CompileBlock(BlockEntry & block_entry) { std::lock_guard lock(m_address_locks[block_entry.cfg.start_address].first); + int loopiteration = 0; while (m_address_locks[block_entry.cfg.start_address].second.load() > 0) + { std::this_thread::yield(); + if (loopiteration++ > 10000000) + return; + } std::get<1>(m_address_to_function[block_entry.cfg.start_address]) = std::unique_ptr(compileResult.second); std::get<0>(m_address_to_function[block_entry.cfg.start_address]) = compileResult.first;