mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 03:59:52 +00:00
fix race between timer firing vs. alarm_timer->pending = 0
The period for Win32 timers is very short and always the same independent of dynticks, so it's possible that the timer fires before qemu_run_all_timers has reset alarm_timer->pending to zero. Reset alarm_timer->pending before rearming. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
06b611c48e
commit
ca5a2a4b12
@ -706,14 +706,14 @@ void configure_icount(const char *option)
|
||||
|
||||
void qemu_run_all_timers(void)
|
||||
{
|
||||
alarm_timer->pending = 0;
|
||||
|
||||
/* rearm timer, if not periodic */
|
||||
if (alarm_timer->expired) {
|
||||
alarm_timer->expired = 0;
|
||||
qemu_rearm_alarm_timer(alarm_timer);
|
||||
}
|
||||
|
||||
alarm_timer->pending = 0;
|
||||
|
||||
/* vm time timers */
|
||||
if (vm_running) {
|
||||
qemu_run_timers(vm_clock);
|
||||
|
Loading…
Reference in New Issue
Block a user