aboutsummaryrefslogtreecommitdiff
path: root/qemu-timer.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-03-12 17:43:49 +0100
committerBlue Swirl <blauwirbel@gmail.com>2011-03-13 14:44:20 +0000
commitcfced5b2e620d7cc44844a550db5488ee348dffc (patch)
tree6f4ecd6ae6f3bb7cef24cc73df9ced4fa83a5cc8 /qemu-timer.c
parent9931b2f4c722655d33f886181374498a39c3f489 (diff)
downloadqemu-cfced5b2e620d7cc44844a550db5488ee348dffc.zip
qemu-cfced5b2e620d7cc44844a550db5488ee348dffc.tar.gz
qemu-cfced5b2e620d7cc44844a550db5488ee348dffc.tar.bz2
implement win32 dynticks timer
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'qemu-timer.c')
-rw-r--r--qemu-timer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu-timer.c b/qemu-timer.c
index 88c7b28..122e7ed 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -1004,6 +1004,7 @@ static void win32_stop_timer(struct qemu_alarm_timer *t)
static void win32_rearm_timer(struct qemu_alarm_timer *t)
{
struct qemu_alarm_win32 *data = t->priv;
+ int nearest_delta_ms;
assert(alarm_has_dynticks(t));
if (!active_timers[QEMU_CLOCK_REALTIME] &&
@@ -1013,7 +1014,11 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t)
timeKillEvent(data->timerId);
- data->timerId = timeSetEvent(1,
+ nearest_delta_ms = (qemu_next_alarm_deadline() + 999999) / 1000000;
+ if (nearest_delta_ms < 1) {
+ nearest_delta_ms = 1;
+ }
+ data->timerId = timeSetEvent(nearest_delta_ms,
data->period,
host_alarm_handler,
(DWORD)t,