Specify the service thread timers in ms instead of us.

This commit is contained in:
Alexandre Julliard 2000-05-10 04:43:32 +00:00
parent 246c360631
commit 8c8237b756
7 changed files with 7 additions and 8 deletions

View File

@ -242,7 +242,7 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
} else { } else {
TRACE("Using the service thread\n"); TRACE("Using the service thread\n");
/* time is in µs */ /* time is in µs */
infoPtr->hService = SERVICE_AddTimer(infoPtr->mah.dwMicroSecPerFrame, infoPtr->hService = SERVICE_AddTimer(infoPtr->mah.dwMicroSecPerFrame / 1000,
ANIMATE_ServiceCallback, (DWORD)infoPtr); ANIMATE_ServiceCallback, (DWORD)infoPtr);
} }

View File

@ -150,7 +150,7 @@ static LPWINE_MM_IDATA MULTIMEDIA_MMTimeStart(void)
iData->mmSysTimeMS = GetTickCount(); iData->mmSysTimeMS = GetTickCount();
iData->lpTimerList = NULL; iData->lpTimerList = NULL;
/* 10ms seems a reasonable value ?? */ /* 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; return iData;

View File

@ -82,7 +82,7 @@ int VGA_SetMode(unsigned Xres,unsigned Yres,unsigned Depth)
} }
vga_refresh=0; vga_refresh=0;
/* poll every 20ms (50fps should provide adequate responsiveness) */ /* poll every 20ms (50fps should provide adequate responsiveness) */
VGA_InstallTimer(20000); VGA_InstallTimer(20);
} }
return 0; return 0;
} }
@ -160,7 +160,7 @@ int VGA_SetAlphaMode(unsigned Xres,unsigned Yres)
if (lpddraw) VGA_Exit(); if (lpddraw) VGA_Exit();
/* the xterm is slow, so refresh only every 200ms (5fps) */ /* the xterm is slow, so refresh only every 200ms (5fps) */
VGA_InstallTimer(200000); VGA_InstallTimer(200);
siz.X = Xres; siz.X = Xres;
siz.Y = Yres; siz.Y = Yres;

View File

@ -57,7 +57,7 @@ static void CALLBACK SYSTEM_TimerTick( ULONG_PTR arg )
static void SYSTEM_StartTicks(void) static void SYSTEM_StartTicks(void)
{ {
if ( SYS_Service == INVALID_HANDLE_VALUE ) 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 );
} }

View File

@ -201,7 +201,6 @@ HANDLE SERVICE_AddTimer( LONG rate,
handle = CreateWaitableTimerA( NULL, FALSE, NULL ); handle = CreateWaitableTimerA( NULL, FALSE, NULL );
if (!handle) return INVALID_HANDLE_VALUE; if (!handle) return INVALID_HANDLE_VALUE;
rate = (rate + 500) / 1000; /* us -> ms */
if (!rate) rate = 1; if (!rate) rate = 1;
when.s.LowPart = when.s.HighPart = 0; when.s.LowPart = when.s.HighPart = 0;
if (!SetWaitableTimer( handle, &when, rate, NULL, NULL, FALSE )) if (!SetWaitableTimer( handle, &when, rate, NULL, NULL, FALSE ))

View File

@ -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 ); if (proc) WINPROC_SetProc( &pTimer->proc, proc, type, WIN_PROC_TIMER );
pTimer->expired = FALSE; 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 ); TIMER_CheckTimer, (ULONG_PTR)pTimer );
TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n", TRACE("Timer added: %p, %04x, %04x, %04x, %08lx\n",

View File

@ -167,7 +167,7 @@ BOOL X11DRV_EVENT_Init(void)
if ( Options.synchronous ) if ( Options.synchronous )
TSXSynchronize( display, True ); TSXSynchronize( display, True );
else else
SERVICE_AddTimer( 200000L, EVENT_Flush, 0 ); SERVICE_AddTimer( 200, EVENT_Flush, 0 );
return TRUE; return TRUE;
} }