diff options
author | David 'Digit' Turner <digit@android.com> | 2010-10-15 15:05:04 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2010-10-18 10:44:11 +0200 |
commit | 6b512811e01d7c81348bfa9c29c21f788ccc0a8e (patch) | |
tree | d87abe06cf3eaaa3ed9ff39e692f6497e6fb97b7 /qemu-timer-ui.c | |
parent | 3ba139cbc278f905bfb1c13f3b92fb88a1f2a36f (diff) | |
download | external_qemu-6b512811e01d7c81348bfa9c29c21f788ccc0a8e.zip external_qemu-6b512811e01d7c81348bfa9c29c21f788ccc0a8e.tar.gz external_qemu-6b512811e01d7c81348bfa9c29c21f788ccc0a8e.tar.bz2 |
Fix windows event loop handling.
This change fixes the windows emulator binary which got stuck
due to changes in the timer implementation that occured during
the last upstream integration.
Change-Id: I090ce4ac9c09b3b95e0df95513446922120b2d9a
Diffstat (limited to 'qemu-timer-ui.c')
-rw-r--r-- | qemu-timer-ui.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/qemu-timer-ui.c b/qemu-timer-ui.c index 5a734b5..912e634 100644 --- a/qemu-timer-ui.c +++ b/qemu-timer-ui.c @@ -934,6 +934,12 @@ static void win32_rearm_timer(struct qemu_alarm_timer *t) #endif /* _WIN32 */ +static void alarm_timer_on_change_state_rearm(void *opaque, int running, int reason) +{ + if (running) + qemu_rearm_alarm_timer((struct qemu_alarm_timer *) opaque); +} + int init_timer_alarm(void) { struct qemu_alarm_timer *t = NULL; @@ -971,28 +977,6 @@ void quit_timers(void) int qemu_calculate_timeout(void) { - int timeout; - - { - /* XXX: use timeout computed from timers */ - int64_t add; - int64_t delta = 0; - /* Advance virtual time to the next event. */ - { - /* Wait for either IO to occur or the next - timer event. */ - add = qemu_next_deadline(); - /* We advance the timer before checking for IO. - Limit the amount we advance so that early IO - activity won't get the guest too far ahead. */ - if (add > 10000000) - add = 10000000; - delta += add; - timeout = delta / 1000000; - if (timeout < 0) - timeout = 0; - } - } - - return timeout; + /* Deliver user events at 30 Hz */ + return 1000/30; } |