mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-07-09 17:25:18 -06:00
PPU LLVM: Fix core_lock locking
Co-Authored-By: Megamouse <23019877+Megamouse@users.noreply.github.com>
This commit is contained in:
parent
73d9f34907
commit
b90eef3fa7
@ -5336,11 +5336,26 @@ bool ppu_initialize(const ppu_module<lv2_obj>& info, bool check_only, u64 file_s
|
|||||||
, thread_op(work_cv, workload, cpu, info, cache_path, g_fxo->get<jit_core_allocator>().sem)
|
, thread_op(work_cv, workload, cpu, info, cache_path, g_fxo->get<jit_core_allocator>().sem)
|
||||||
, [&](u32 /*thread_index*/, thread_op& op)
|
, [&](u32 /*thread_index*/, thread_op& op)
|
||||||
{
|
{
|
||||||
|
const bool to_lock = work_cv < workload.size() && (cpu ? !cpu->state.all_of(cpu_flag::exit) : !Emu.IsStopped());
|
||||||
|
|
||||||
|
if (!to_lock)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Allocate "core"
|
// Allocate "core"
|
||||||
op.core_lock.lock();
|
op.core_lock.lock();
|
||||||
|
|
||||||
// Second check before creating another thread
|
// Second check before creating another thread
|
||||||
return work_cv < workload.size() && (cpu ? !cpu->state.all_of(cpu_flag::exit) : !Emu.IsStopped());
|
const bool to_unlock = !(work_cv < workload.size() && (cpu ? !cpu->state.all_of(cpu_flag::exit) : !Emu.IsStopped()));
|
||||||
|
|
||||||
|
if (to_unlock)
|
||||||
|
{
|
||||||
|
op.core_lock.unlock();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
threads.join();
|
threads.join();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user