mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12: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 changed files with 10 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "Emu/Memory/vm.h"
|
#include "Emu/Memory/vm.h"
|
||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
#include "Emu/IdManager.h"
|
#include "Emu/IdManager.h"
|
||||||
|
@ -33,6 +33,7 @@ void lv2_timer_context::operator()()
|
||||||
if (const auto queue = port.lock())
|
if (const auto queue = port.lock())
|
||||||
{
|
{
|
||||||
queue->send(source, data1, data2, next);
|
queue->send(source, data1, data2, next);
|
||||||
|
}
|
||||||
|
|
||||||
if (period)
|
if (period)
|
||||||
{
|
{
|
||||||
|
@ -40,10 +41,9 @@ void lv2_timer_context::operator()()
|
||||||
expire += period;
|
expire += period;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Stop: oneshot or the event port was disconnected (TODO: is it correct?)
|
// Stop after oneshot
|
||||||
state = SYS_TIMER_STATE_STOP;
|
state.compare_and_swap_test(SYS_TIMER_STATE_RUN, SYS_TIMER_STATE_STOP);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue