Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e2a1bc98
Commit
e2a1bc98
authored
May 05, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm: Use criticalsection for determining wether timer is synchronously killable.
parent
db07476c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
time.c
dlls/winmm/time.c
+10
-7
No files found.
dlls/winmm/time.c
View file @
e2a1bc98
...
@@ -44,8 +44,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmtime);
...
@@ -44,8 +44,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmtime);
static
HANDLE
TIME_hMMTimer
;
static
HANDLE
TIME_hMMTimer
;
static
LPWINE_TIMERENTRY
TIME_TimersList
;
static
LPWINE_TIMERENTRY
TIME_TimersList
;
static
HANDLE
TIME_hKillEvent
;
static
HANDLE
TIME_hWakeEvent
;
static
HANDLE
TIME_hWakeEvent
;
static
CRITICAL_SECTION
TIME_cbcrst
;
static
BOOL
TIME_TimeToDie
=
TRUE
;
static
BOOL
TIME_TimeToDie
=
TRUE
;
/*
/*
...
@@ -200,11 +200,11 @@ static LPWINE_TIMERENTRY lpTimers;
...
@@ -200,11 +200,11 @@ static LPWINE_TIMERENTRY lpTimers;
ptimer
=
next_ptimer
;
ptimer
=
next_ptimer
;
}
}
if
(
TIME_hKillEvent
)
ResetEvent
(
TIME_hKillEvent
);
LeaveCriticalSection
(
&
iData
->
cs
);
LeaveCriticalSection
(
&
iData
->
cs
);
EnterCriticalSection
(
&
TIME_cbcrst
);
while
(
idx
>
0
)
TIME_TriggerCallBack
(
&
lpTimers
[
--
idx
]);
while
(
idx
>
0
)
TIME_TriggerCallBack
(
&
lpTimers
[
--
idx
]);
if
(
TIME_hKillEvent
)
SetEvent
(
TIME_hKillEven
t
);
LeaveCriticalSection
(
&
TIME_cbcrs
t
);
/* Finally, adjust the recommended wait time downward
/* Finally, adjust the recommended wait time downward
by the amount of time the processing routines
by the amount of time the processing routines
...
@@ -266,6 +266,8 @@ void TIME_MMTimeStart(void)
...
@@ -266,6 +266,8 @@ void TIME_MMTimeStart(void)
TIME_TimeToDie
=
FALSE
;
TIME_TimeToDie
=
FALSE
;
TIME_hMMTimer
=
CreateThread
(
NULL
,
0
,
TIME_MMSysTimeThread
,
&
WINMM_IData
,
0
,
NULL
);
TIME_hMMTimer
=
CreateThread
(
NULL
,
0
,
TIME_MMSysTimeThread
,
&
WINMM_IData
,
0
,
NULL
);
SetThreadPriority
(
TIME_hMMTimer
,
THREAD_PRIORITY_TIME_CRITICAL
);
SetThreadPriority
(
TIME_hMMTimer
,
THREAD_PRIORITY_TIME_CRITICAL
);
InitializeCriticalSection
(
&
TIME_cbcrst
);
TIME_cbcrst
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": WINMM.TIME_cbcrst"
);
}
}
}
}
...
@@ -285,6 +287,8 @@ void TIME_MMTimeStop(void)
...
@@ -285,6 +287,8 @@ void TIME_MMTimeStop(void)
CloseHandle
(
TIME_hMMTimer
);
CloseHandle
(
TIME_hMMTimer
);
CloseHandle
(
TIME_hWakeEvent
);
CloseHandle
(
TIME_hWakeEvent
);
TIME_hMMTimer
=
0
;
TIME_hMMTimer
=
0
;
TIME_cbcrst
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
TIME_cbcrst
);
TIME_TimersList
=
NULL
;
TIME_TimersList
=
NULL
;
}
}
}
}
...
@@ -337,9 +341,6 @@ WORD TIME_SetEventInternal(UINT wDelay, UINT wResol,
...
@@ -337,9 +341,6 @@ WORD TIME_SetEventInternal(UINT wDelay, UINT wResol,
EnterCriticalSection
(
&
WINMM_IData
.
cs
);
EnterCriticalSection
(
&
WINMM_IData
.
cs
);
if
((
wFlags
&
TIME_KILL_SYNCHRONOUS
)
&&
!
TIME_hKillEvent
)
TIME_hKillEvent
=
CreateEventW
(
NULL
,
TRUE
,
TRUE
,
NULL
);
for
(
lpTimer
=
TIME_TimersList
;
lpTimer
!=
NULL
;
lpTimer
=
lpTimer
->
lpNext
)
{
for
(
lpTimer
=
TIME_TimersList
;
lpTimer
!=
NULL
;
lpTimer
=
lpTimer
->
lpNext
)
{
wNewID
=
max
(
wNewID
,
lpTimer
->
wTimerID
);
wNewID
=
max
(
wNewID
,
lpTimer
->
wTimerID
);
}
}
...
@@ -397,8 +398,10 @@ MMRESULT WINAPI timeKillEvent(UINT wID)
...
@@ -397,8 +398,10 @@ MMRESULT WINAPI timeKillEvent(UINT wID)
return
MMSYSERR_INVALPARAM
;
return
MMSYSERR_INVALPARAM
;
}
}
if
(
lpSelf
->
wFlags
&
TIME_KILL_SYNCHRONOUS
)
if
(
lpSelf
->
wFlags
&
TIME_KILL_SYNCHRONOUS
)
WaitForSingleObject
(
TIME_hKillEvent
,
INFINITE
);
EnterCriticalSection
(
&
TIME_cbcrst
);
HeapFree
(
GetProcessHeap
(),
0
,
lpSelf
);
HeapFree
(
GetProcessHeap
(),
0
,
lpSelf
);
if
(
lpSelf
->
wFlags
&
TIME_KILL_SYNCHRONOUS
)
LeaveCriticalSection
(
&
TIME_cbcrst
);
return
TIMERR_NOERROR
;
return
TIMERR_NOERROR
;
}
}
...
...
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