Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
e8af10e6
Commit
e8af10e6
authored
17 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
winmm: Convert the timer list to a standard Wine list.
parent
371b0edb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/winmm/time.c
+17
-24
17 additions, 24 deletions
dlls/winmm/time.c
dlls/winmm/winemm.h
+0
-1
0 additions, 1 deletion
dlls/winmm/winemm.h
with
17 additions
and
25 deletions
dlls/winmm/time.c
+
17
−
24
View file @
e8af10e6
...
...
@@ -45,11 +45,13 @@
#include
"winemm.h"
#include
"wine/list.h"
#include
"wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mmtime
);
typedef
struct
tagWINE_TIMERENTRY
{
struct
list
entry
;
UINT
wDelay
;
UINT
wResol
;
LPTIMECALLBACK
lpFunc
;
/* can be lots of things */
...
...
@@ -57,12 +59,11 @@ typedef struct tagWINE_TIMERENTRY {
UINT16
wFlags
;
UINT16
wTimerID
;
DWORD
dwTriggerTime
;
struct
tagWINE_TIMERENTRY
*
lpNext
;
}
WINE_TIMERENTRY
,
*
LPWINE_TIMERENTRY
;
static
struct
list
timer_list
=
LIST_INIT
(
timer_list
);
static
HANDLE
TIME_hMMTimer
;
static
LPWINE_TIMERENTRY
TIME_TimersList
;
static
CRITICAL_SECTION
TIME_cbcrst
;
static
BOOL
TIME_TimeToDie
=
TRUE
;
static
int
TIME_fdWake
[
2
]
=
{
-
1
,
-
1
};
...
...
@@ -137,7 +138,7 @@ static int TIME_MMSysTimeCallback(void)
static
int
nSizeLpTimers
;
static
LPWINE_TIMERENTRY
lpTimers
;
LP
WINE_TIMERENTRY
timer
,
*
p
timer
,
*
next
_ptimer
;
WINE_TIMERENTRY
*
timer
,
*
next
;
int
idx
;
DWORD
cur_time
;
int
delta_time
,
ret_time
=
-
1
;
...
...
@@ -160,9 +161,8 @@ static LPWINE_TIMERENTRY lpTimers;
cur_time
=
GetTickCount
();
EnterCriticalSection
(
&
WINMM_cs
);
for
(
ptimer
=
&
TIME_TimersList
;
*
ptimer
!=
NULL
;
)
{
timer
=
*
ptimer
;
next_ptimer
=
&
timer
->
lpNext
;
LIST_FOR_EACH_ENTRY_SAFE
(
timer
,
next
,
&
timer_list
,
WINE_TIMERENTRY
,
entry
)
{
delta_time
=
timer
->
dwTriggerTime
-
cur_time
;
if
(
delta_time
<=
0
)
{
...
...
@@ -188,8 +188,7 @@ static LPWINE_TIMERENTRY lpTimers;
/* TIME_ONESHOT is defined as 0 */
if
(
!
(
timer
->
wFlags
&
TIME_PERIODIC
))
{
/* unlink timer from timers list */
*
ptimer
=
*
next_ptimer
;
list_remove
(
&
timer
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
timer
);
/* We don't need to trigger oneshots again */
...
...
@@ -209,8 +208,6 @@ static LPWINE_TIMERENTRY lpTimers;
{
if
(
ret_time
==
-
1
||
ret_time
>
delta_time
)
ret_time
=
delta_time
;
}
ptimer
=
next_ptimer
;
}
LeaveCriticalSection
(
&
WINMM_cs
);
...
...
@@ -277,10 +274,9 @@ static DWORD CALLBACK TIME_MMSysTimeThread(LPVOID arg)
/**************************************************************************
* TIME_MMTimeStart
*/
void
TIME_MMTimeStart
(
void
)
static
void
TIME_MMTimeStart
(
void
)
{
if
(
!
TIME_hMMTimer
)
{
TIME_TimersList
=
NULL
;
if
(
pipe
(
TIME_fdWake
)
<
0
)
{
TIME_fdWake
[
0
]
=
TIME_fdWake
[
1
]
=
-
1
;
...
...
@@ -316,7 +312,6 @@ void TIME_MMTimeStop(void)
TIME_hMMTimer
=
0
;
TIME_cbcrst
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
TIME_cbcrst
);
TIME_TimersList
=
NULL
;
}
}
...
...
@@ -369,12 +364,10 @@ WORD TIME_SetEventInternal(UINT wDelay, UINT wResol,
EnterCriticalSection
(
&
WINMM_cs
);
for
(
lpTimer
=
TIME_TimersList
;
lpTimer
!=
NULL
;
lpTimer
=
lpTimer
->
lpNext
)
{
wNewID
=
max
(
wNewID
,
lpTimer
->
wTimerID
);
}
LIST_FOR_EACH_ENTRY
(
lpTimer
,
&
timer_list
,
WINE_TIMERENTRY
,
entry
)
wNewID
=
max
(
wNewID
,
lpTimer
->
wTimerID
);
lpNewTimer
->
lpNext
=
TIME_TimersList
;
TIME_TimersList
=
lpNewTimer
;
list_add_head
(
&
timer_list
,
&
lpNewTimer
->
entry
);
lpNewTimer
->
wTimerID
=
wNewID
+
1
;
LeaveCriticalSection
(
&
WINMM_cs
);
...
...
@@ -405,16 +398,16 @@ MMRESULT WINAPI timeSetEvent(UINT wDelay, UINT wResol, LPTIMECALLBACK lpFunc,
*/
MMRESULT
WINAPI
timeKillEvent
(
UINT
wID
)
{
LP
WINE_TIMERENTRY
lpSelf
=
NULL
,
*
lpTimer
;
WINE_TIMERENTRY
*
lpSelf
=
NULL
,
*
lpTimer
;
TRACE
(
"(%u)
\n
"
,
wID
);
EnterCriticalSection
(
&
WINMM_cs
);
/* remove WINE_TIMERENTRY from list */
for
(
lpTimer
=
&
TIME_T
imer
sL
ist
;
*
lpTimer
;
lpTimer
=
&
(
*
lpTimer
)
->
lpNext
)
{
if
(
wID
==
(
*
lpTimer
)
->
wTimerID
)
{
lpSelf
=
*
lpTimer
;
/* unlink timer of id 'wID' */
*
lpTimer
=
(
*
lpTimer
)
->
lpNext
;
LIST_FOR_EACH_ENTRY
(
lpTimer
,
&
t
imer
_l
ist
,
WINE_TIMERENTRY
,
entry
)
{
if
(
wID
=
=
lpTimer
->
wTimerID
)
{
lpSelf
=
lpTimer
;
list_remove
(
&
lpTimer
->
entry
)
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
dlls/winmm/winemm.h
+
0
−
1
View file @
e8af10e6
...
...
@@ -241,7 +241,6 @@ LPWINE_MMIO MMIO_Get(HMMIO h);
WORD
TIME_SetEventInternal
(
UINT
wDelay
,
UINT
wResol
,
LPTIMECALLBACK
lpFunc
,
DWORD
dwUser
,
UINT
wFlags
);
void
TIME_MMTimeStart
(
void
);
void
TIME_MMTimeStop
(
void
);
/* Global variables */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment