mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 20:15:27 +00:00
sys_spu: Add one more limiting SPU threads creation condition
This commit is contained in:
parent
9d71369b2c
commit
9f67e00e40
1 changed files with 9 additions and 1 deletions
|
@ -238,7 +238,7 @@ struct spu_limits_t
|
|||
|
||||
raw_spu_count += spu_thread::g_raw_spu_ctr;
|
||||
|
||||
if (spu_limit + raw_limit > 6 || raw_spu_count > raw_limit || physical_spus_count + controllable_spu_count > spu_limit)
|
||||
if (spu_limit + raw_limit > 6 || raw_spu_count > raw_limit || physical_spus_count >= spu_limit || physical_spus_count + controllable_spu_count > spu_limit)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -714,6 +714,10 @@ error_code sys_spu_thread_group_destroy(ppu_thread& ppu, u32 id)
|
|||
|
||||
sys_spu.warning("sys_spu_thread_group_destroy(id=0x%x)", id);
|
||||
|
||||
auto& limits = g_fxo->get<spu_limits_t>();
|
||||
|
||||
std::lock_guard lock(limits.mutex);
|
||||
|
||||
const auto group = idm::withdraw<lv2_spu_group>(id, [](lv2_spu_group& group) -> CellError
|
||||
{
|
||||
if (!group.run_state.fetch_op([](spu_group_status& state)
|
||||
|
@ -2052,6 +2056,10 @@ error_code raw_spu_destroy(ppu_thread& ppu, u32 id)
|
|||
|
||||
(*thread)();
|
||||
|
||||
auto& limits = g_fxo->get<spu_limits_t>();
|
||||
|
||||
std::lock_guard lock(limits.mutex);
|
||||
|
||||
if (auto ret = idm::withdraw<named_thread<spu_thread>>(idm_id, [&](spu_thread& spu) -> CellError
|
||||
{
|
||||
if (std::addressof(spu) != std::addressof(*thread))
|
||||
|
|
Loading…
Add table
Reference in a new issue