mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
liblv2 HLE: Fix sys_lwcond_signal mode 3
This commit is contained in:
parent
13820d6802
commit
55baaea8e7
@ -100,7 +100,11 @@ error_code sys_lwcond_signal(ppu_thread& ppu, vm::ptr<sys_lwcond_t> lwcond)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if locking succeeded
|
// if locking succeeded
|
||||||
lwmutex->all_info++;
|
lwmutex->lock_var.atomic_op([](typename sys_lwmutex_t::sync_var_t& var)
|
||||||
|
{
|
||||||
|
var.waiter++;
|
||||||
|
var.owner = lwmutex_reserved;
|
||||||
|
});
|
||||||
|
|
||||||
// call the syscall
|
// call the syscall
|
||||||
if (error_code res = _sys_lwcond_signal(ppu, lwcond->lwcond_queue, lwmutex->sleep_queue, -1, 3))
|
if (error_code res = _sys_lwcond_signal(ppu, lwcond->lwcond_queue, lwmutex->sleep_queue, -1, 3))
|
||||||
@ -110,7 +114,11 @@ error_code sys_lwcond_signal(ppu_thread& ppu, vm::ptr<sys_lwcond_t> lwcond)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lwmutex->all_info--;
|
lwmutex->lock_var.atomic_op([&](typename sys_lwmutex_t::sync_var_t& var)
|
||||||
|
{
|
||||||
|
var.waiter--;
|
||||||
|
var.owner = ppu.id;
|
||||||
|
});
|
||||||
|
|
||||||
// unlock the lightweight mutex
|
// unlock the lightweight mutex
|
||||||
sys_lwmutex_unlock(ppu, lwmutex);
|
sys_lwmutex_unlock(ppu, lwmutex);
|
||||||
@ -245,7 +253,11 @@ error_code sys_lwcond_signal_to(ppu_thread& ppu, vm::ptr<sys_lwcond_t> lwcond, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if locking succeeded
|
// if locking succeeded
|
||||||
lwmutex->all_info++;
|
lwmutex->lock_var.atomic_op([](typename sys_lwmutex_t::sync_var_t& var)
|
||||||
|
{
|
||||||
|
var.waiter++;
|
||||||
|
var.owner = lwmutex_reserved;
|
||||||
|
});
|
||||||
|
|
||||||
// call the syscall
|
// call the syscall
|
||||||
if (error_code res = _sys_lwcond_signal(ppu, lwcond->lwcond_queue, lwmutex->sleep_queue, ppu_thread_id, 3))
|
if (error_code res = _sys_lwcond_signal(ppu, lwcond->lwcond_queue, lwmutex->sleep_queue, ppu_thread_id, 3))
|
||||||
@ -255,7 +267,11 @@ error_code sys_lwcond_signal_to(ppu_thread& ppu, vm::ptr<sys_lwcond_t> lwcond, u
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lwmutex->all_info--;
|
lwmutex->lock_var.atomic_op([&](typename sys_lwmutex_t::sync_var_t& var)
|
||||||
|
{
|
||||||
|
var.waiter--;
|
||||||
|
var.owner = ppu.id;
|
||||||
|
});
|
||||||
|
|
||||||
// unlock the lightweight mutex
|
// unlock the lightweight mutex
|
||||||
sys_lwmutex_unlock(ppu, lwmutex);
|
sys_lwmutex_unlock(ppu, lwmutex);
|
||||||
|
@ -178,7 +178,7 @@ error_code sys_lwmutex_lock(ppu_thread& ppu, vm::ptr<sys_lwmutex_t> lwmutex, u64
|
|||||||
// locking succeeded
|
// locking succeeded
|
||||||
auto old = lwmutex->vars.owner.exchange(tid);
|
auto old = lwmutex->vars.owner.exchange(tid);
|
||||||
|
|
||||||
if (old != lwmutex_reserved && old >> 24 != 1)
|
if (old != lwmutex_reserved)
|
||||||
{
|
{
|
||||||
fmt::throw_exception("Locking failed (lwmutex=*0x%x, owner=0x%x)" HERE, lwmutex, old);
|
fmt::throw_exception("Locking failed (lwmutex=*0x%x, owner=0x%x)" HERE, lwmutex, old);
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ error_code sys_lwmutex_trylock(ppu_thread& ppu, vm::ptr<sys_lwmutex_t> lwmutex)
|
|||||||
// locking succeeded
|
// locking succeeded
|
||||||
auto old = lwmutex->vars.owner.exchange(tid);
|
auto old = lwmutex->vars.owner.exchange(tid);
|
||||||
|
|
||||||
if (old != lwmutex_reserved && old >> 24 != 1)
|
if (old != lwmutex_reserved)
|
||||||
{
|
{
|
||||||
fmt::throw_exception("Locking failed (lwmutex=*0x%x, owner=0x%x)" HERE, lwmutex, old);
|
fmt::throw_exception("Locking failed (lwmutex=*0x%x, owner=0x%x)" HERE, lwmutex, old);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user