1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

sys_timer: weak_ptr -> shared_ptr

This commit is contained in:
Eladash 2021-05-14 17:46:16 +03:00 committed by Ivan
parent 47436bd774
commit 33580e0aa1
2 changed files with 8 additions and 8 deletions

View File

@ -34,9 +34,9 @@ void lv2_timer_context::operator()()
continue;
}
if (const auto queue = port.lock())
if (port)
{
queue->send(source, data1, data2, next);
port->send(source, data1, data2, next);
}
if (period)
@ -151,16 +151,16 @@ error_code _sys_timer_start(ppu_thread& ppu, u32 timer_id, u64 base_time, u64 pe
{
std::unique_lock lock(timer.mutex);
if (!lv2_event_queue::check(timer.port))
{
return CELL_ENOTCONN;
}
if (timer.state != SYS_TIMER_STATE_STOP)
{
return CELL_EBUSY;
}
if (timer.port.expired())
{
return CELL_ENOTCONN;
}
// sys_timer_start_periodic() will use current time (TODO: is it correct?)
timer.expire = base_time ? base_time : start_time + period;
timer.period = period;

View File

@ -30,7 +30,7 @@ struct lv2_timer_context : lv2_obj
shared_mutex mutex;
atomic_t<u32> state{SYS_TIMER_STATE_STOP};
std::weak_ptr<lv2_event_queue> port;
std::shared_ptr<lv2_event_queue> port;
u64 source;
u64 data1;
u64 data2;