From 8c8237b7566a0bc6a365aad79a8d274989a9177b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 10 May 2000 04:43:32 +0000 Subject: [PATCH] Specify the service thread timers in ms instead of us. --- dlls/comctl32/animate.c | 2 +- dlls/winmm/time.c | 2 +- graphics/vga.c | 4 ++-- misc/system.c | 2 +- scheduler/services.c | 1 - windows/timer.c | 2 +- windows/x11drv/event.c | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index e243af9a06..87665d83e7 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -242,7 +242,7 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam) } else { TRACE("Using the service thread\n"); /* time is in µs */ - infoPtr->hService = SERVICE_AddTimer(infoPtr->mah.dwMicroSecPerFrame, + infoPtr->hService = SERVICE_AddTimer(infoPtr->mah.dwMicroSecPerFrame / 1000, ANIMATE_ServiceCallback, (DWORD)infoPtr); } diff --git a/dlls/winmm/time.c b/dlls/winmm/time.c index 8e475c902d..97f860298a 100644 --- a/dlls/winmm/time.c +++ b/dlls/winmm/time.c @@ -150,7 +150,7 @@ static LPWINE_MM_IDATA MULTIMEDIA_MMTimeStart(void) iData->mmSysTimeMS = GetTickCount(); iData->lpTimerList = NULL; /* 10ms seems a reasonable value ?? */ - iData->hMMTimer = SERVICE_AddTimer(10*1000L, TIME_MMSysTimeCallback, (DWORD)iData); + iData->hMMTimer = SERVICE_AddTimer(10, TIME_MMSysTimeCallback, (DWORD)iData); } return iData; diff --git a/graphics/vga.c b/graphics/vga.c index 62f16ee488..dedc0c880d 100644 --- a/graphics/vga.c +++ b/graphics/vga.c @@ -82,7 +82,7 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth) } vga_refresh=0; /* poll every 20ms (50fps should provide adequate responsiveness) */ - VGA_InstallTimer(20000); + VGA_InstallTimer(20); } return 0; } @@ -160,7 +160,7 @@ int VGA_SetAlphaMode(unsigned Xres,unsigned Yres) if (lpddraw) VGA_Exit(); /* the xterm is slow, so refresh only every 200ms (5fps) */ - VGA_InstallTimer(200000); + VGA_InstallTimer(200); siz.X = Xres; siz.Y = Yres; diff --git a/misc/system.c b/misc/system.c index dbb71a0b60..ad5c84996e 100644 --- a/misc/system.c +++ b/misc/system.c @@ -57,7 +57,7 @@ static void CALLBACK SYSTEM_TimerTick( ULONG_PTR arg ) static void SYSTEM_StartTicks(void) { if ( SYS_Service == INVALID_HANDLE_VALUE ) - SYS_Service = SERVICE_AddTimer( SYS_TIMER_RATE, SYSTEM_TimerTick, 0L ); + SYS_Service = SERVICE_AddTimer( (SYS_TIMER_RATE+500)/1000, SYSTEM_TimerTick, 0L ); } diff --git a/scheduler/services.c b/scheduler/services.c index d2b6f316a4..8cc45feee0 100644 --- a/scheduler/services.c +++ b/scheduler/services.c @@ -201,7 +201,6 @@ HANDLE SERVICE_AddTimer( LONG rate, handle = CreateWaitableTimerA( NULL, FALSE, NULL ); if (!handle) return INVALID_HANDLE_VALUE; - rate = (rate + 500) / 1000; /* us -> ms */ if (!rate) rate = 1; when.s.LowPart = when.s.HighPart = 0; if (!SetWaitableTimer( handle, &when, rate, NULL, NULL, FALSE )) diff --git a/windows/timer.c b/windows/timer.c index dd99e40fad..4da21f1813 100644 --- a/windows/timer.c +++ b/windows/timer.c @@ -241,7 +241,7 @@ static UINT TIMER_SetTimer( HWND hwnd, UINT id, UINT timeout, if (proc) WINPROC_SetProc( &pTimer->proc, proc, type, WIN_PROC_TIMER ); pTimer->expired = FALSE; - pTimer->hService = SERVICE_AddTimer( max( timeout * 1000L, SYS_TIMER_RATE ), + pTimer->hService = SERVICE_AddTimer( max( timeout, (SYS_TIMER_RATE+500)/1000 ), TIMER_CheckTimer, (ULONG_PTR)pTimer ); TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n", diff --git a/windows/x11drv/event.c b/windows/x11drv/event.c index 6ab43346e1..84aaec671b 100644 --- a/windows/x11drv/event.c +++ b/windows/x11drv/event.c @@ -167,7 +167,7 @@ BOOL X11DRV_EVENT_Init(void) if ( Options.synchronous ) TSXSynchronize( display, True ); else - SERVICE_AddTimer( 200000L, EVENT_Flush, 0 ); + SERVICE_AddTimer( 200, EVENT_Flush, 0 ); return TRUE; } -- 2.32.0.93.g670b81a890