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

@ -2489,7 +2489,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value)
const auto queue = (std::lock_guard{group->mutex}, this->spup[spup].lock());
if (!queue)
if (!lv2_event_queue::check(queue))
{
spu_log.warning("sys_spu_thread_send_event(spup=%d, data0=0x%x, data1=0x%x): event queue not connected", spup, (value & 0x00ffffff), data);
ch_in_mbox.set_values(1, CELL_ENOTCONN);
@ -2521,7 +2521,7 @@ bool spu_thread::set_ch_value(u32 ch, u32 value)
const auto queue = (std::lock_guard{group->mutex}, this->spup[spup].lock());
if (!queue)
if (!lv2_event_queue::check(queue))
{
spu_log.warning("sys_spu_thread_throw_event(spup=%d, data0=0x%x, data1=0x%x): event queue not connected", spup, (value & 0x00ffffff), data);
return true;
@ -2904,14 +2904,14 @@ bool spu_thread::stop_and_signal(u32 code)
{
queue = v.second.lock();
if (queue)
if (lv2_event_queue::check(queue))
{
break;
}
}
}
if (!queue)
if (!lv2_event_queue::check(queue))
{
check_state();
return ch_in_mbox.set_values(1, CELL_EINVAL), true; // TODO: check error value
@ -3024,14 +3024,14 @@ bool spu_thread::stop_and_signal(u32 code)
{
if (spuq == v.first)
{
if ((queue = v.second.lock()))
if (queue = v.second.lock(); lv2_event_queue::check(queue))
{
break;
}
}
}
if (!queue)
if (!lv2_event_queue::check(queue))
{
return ch_in_mbox.set_values(1, CELL_EINVAL), true;
}