sys_event_queue: Fix ports disconnection after queue destruction

This commit is contained in:
Eladash 2020-04-09 19:05:43 +03:00 committed by Ivan
parent 37110098c7
commit 2b75df22d9
5 changed files with 46 additions and 21 deletions

View file

@ -82,7 +82,7 @@ error_code sys_timer_destroy(ppu_thread& ppu, u32 timer_id)
const auto timer = idm::withdraw<lv2_obj, lv2_timer>(timer_id, [&](lv2_timer& timer) -> CellError
{
if (std::shared_lock lock(timer.mutex); !timer.port.expired())
if (std::shared_lock lock(timer.mutex); lv2_event_queue::check(timer.port))
{
return CELL_EISCONN;
}
@ -231,7 +231,7 @@ error_code sys_timer_connect_event_queue(ppu_thread& ppu, u32 timer_id, u32 queu
std::lock_guard lock(timer.mutex);
if (!timer.port.expired())
if (lv2_event_queue::check(timer.port))
{
return CELL_EISCONN;
}
@ -269,7 +269,7 @@ error_code sys_timer_disconnect_event_queue(ppu_thread& ppu, u32 timer_id)
timer.state = SYS_TIMER_STATE_STOP;
if (timer.port.expired())
if (!lv2_event_queue::check(timer.port))
{
return CELL_ENOTCONN;
}