summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2007-03-28 14:46:30 -0400
committerKeith Packard <keithp@neko.keithp.com>2007-04-05 23:32:56 -0700
commit44ea7a3e0d8fa636f4e5dd392caf618120d98413 (patch)
tree28941b7f0d7445876c6aecb878f9cc0f18229b03
parent042ef1f573d6e98756cc98c296bddd1aa9e4c8ca (diff)
Bug #10296: Fix timer rescheduling.
(cherry picked from commit 8c7f56d92d8471ee059c14d322af5f7f555dd5c6)
-rw-r--r--os/WaitFor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/os/WaitFor.c b/os/WaitFor.c
index ba227a3b6..d0f9f62f1 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -125,7 +125,7 @@ struct _OsTimerRec {
};
static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
-static void CheckAllTimers(CARD32 now);
+static void CheckAllTimers(void);
static OsTimerPtr timers = NULL;
/*****************
@@ -204,7 +204,7 @@ WaitForSomething(int *pClientsReady)
timeout = timers->expires - now;
if (timeout > 0 && timeout > timers->delta + 250) {
/* time has rewound. reset the timers. */
- CheckAllTimers(now);
+ CheckAllTimers();
}
if (timers) {
@@ -439,11 +439,14 @@ ANYSET(FdMask *src)
/* If time has rewound, re-run every affected timer.
* Timers might drop out of the list, so we have to restart every time. */
static void
-CheckAllTimers(CARD32 now)
+CheckAllTimers(void)
{
OsTimerPtr timer;
+ CARD32 now;
start:
+ now = GetTimeInMillis();
+
for (timer = timers; timer; timer = timer->next) {
if (timer->expires - now > timer->delta + 250) {
TimerForce(timer);