Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7160d8c7
Commit
7160d8c7
authored
Nov 26, 2008
by
Peter Dons Tychsen
Committed by
Alexandre Julliard
Nov 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedos: Fixed a problem with timer values that are below 50ms.
parent
cb7a0da5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
timer.c
dlls/winedos/timer.c
+20
-4
No files found.
dlls/winedos/timer.c
View file @
7160d8c7
...
...
@@ -58,6 +58,8 @@ static UINT TIMER_ticks = 0;
/* Number of pending timer IRQs. */
static
LONG
TIMER_pending
=
0
;
/* Number of milliseconds between IRQs. */
static
DWORD
TIMER_millis
=
0
;
/***********************************************************************
* TIMER_Relay
...
...
@@ -81,11 +83,11 @@ static void CALLBACK TIMER_TimerProc( HWND hwnd,
DWORD
dwTime
)
{
LONG
pending
=
InterlockedIncrement
(
&
TIMER_pending
);
DWORD
delta
=
(
dwTime
>=
TIMER_stamp
)
?
(
dwTime
-
TIMER_stamp
)
:
(
0xffffffff
-
(
TIMER_stamp
-
dwTime
));
if
(
pending
>=
TIMER_MAX_PENDING
)
{
DWORD
delta
=
(
dwTime
>=
TIMER_stamp
)
?
(
dwTime
-
TIMER_stamp
)
:
(
0xffffffff
-
(
TIMER_stamp
-
dwTime
));
if
(
delta
>=
60000
)
{
...
...
@@ -97,8 +99,19 @@ static void CALLBACK TIMER_TimerProc( HWND hwnd,
}
else
{
TIMER_stamp
=
dwTime
;
DOSVM_QueueEvent
(
0
,
DOS_PRIORITY_REALTIME
,
TIMER_Relay
,
NULL
);
int
i
;
/* Calculate the number of valid timer interrupts we can generate */
DWORD
count
=
delta
/
TIMER_millis
;
/* Forward the timestamp with the time used */
TIMER_stamp
+=
(
count
*
TIMER_millis
);
/* Generate interrupts */
for
(
i
=
0
;
i
<
count
;
i
++
)
{
DOSVM_QueueEvent
(
0
,
DOS_PRIORITY_REALTIME
,
TIMER_Relay
,
NULL
);
}
}
}
...
...
@@ -122,6 +135,9 @@ static void WINAPI TIMER_DoSetTimer( ULONG_PTR arg )
TIMER_id
=
SetTimer
(
NULL
,
0
,
millis
,
TIMER_TimerProc
);
TIMER_stamp
=
GetTickCount
();
TIMER_ticks
=
arg
;
/* Remember number of milliseconds to wait */
TIMER_millis
=
millis
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment