mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-17 01:15:30 +00:00
Fix timer state after event queue was destroyed
* Hw tests show state is unaffected by external destruction of the event queue * Minor race regarding state check fixed (can result in an undestroyable state)
This commit is contained in:
parent
90490f775d
commit
3c0564c9b7
@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Memory/vm.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
@ -33,17 +33,17 @@ void lv2_timer_context::operator()()
|
||||
if (const auto queue = port.lock())
|
||||
{
|
||||
queue->send(source, data1, data2, next);
|
||||
|
||||
if (period)
|
||||
{
|
||||
// Set next expiration time and check again (HACK)
|
||||
expire += period;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Stop: oneshot or the event port was disconnected (TODO: is it correct?)
|
||||
state = SYS_TIMER_STATE_STOP;
|
||||
if (period)
|
||||
{
|
||||
// Set next expiration time and check again (HACK)
|
||||
expire += period;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Stop after oneshot
|
||||
state.compare_and_swap_test(SYS_TIMER_STATE_RUN, SYS_TIMER_STATE_STOP);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user