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
8db18a89
Commit
8db18a89
authored
Jun 16, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Jun 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: Avoid deadlock in AudioClient_Stop.
parent
cc0ea698
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+19
-7
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
8db18a89
...
...
@@ -1472,13 +1472,15 @@ static void CALLBACK alsa_push_buffer_data(void *user, BOOLEAN timer)
EnterCriticalSection
(
&
This
->
lock
);
if
(
This
->
dataflow
==
eRender
&&
This
->
held_frames
)
alsa_write_data
(
This
);
else
if
(
This
->
dataflow
==
eCapture
)
alsa_read_data
(
This
);
if
(
This
->
started
){
if
(
This
->
dataflow
==
eRender
&&
This
->
held_frames
)
alsa_write_data
(
This
);
else
if
(
This
->
dataflow
==
eCapture
)
alsa_read_data
(
This
);
if
(
This
->
event
)
SetEvent
(
This
->
event
);
if
(
This
->
event
)
SetEvent
(
This
->
event
);
}
LeaveCriticalSection
(
&
This
->
lock
);
}
...
...
@@ -1567,6 +1569,8 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
{
ACImpl
*
This
=
impl_from_IAudioClient
(
iface
);
int
err
;
HANDLE
event
;
BOOL
wait
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -1582,7 +1586,11 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
return
S_FALSE
;
}
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
INVALID_HANDLE_VALUE
);
event
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
wait
=
!
DeleteTimerQueueTimer
(
g_timer_q
,
This
->
timer
,
event
);
if
(
wait
)
WARN
(
"DeleteTimerQueueTimer error %u
\n
"
,
GetLastError
());
wait
=
wait
&&
GetLastError
()
==
ERROR_IO_PENDING
;
if
((
err
=
snd_pcm_drop
(
This
->
pcm_handle
))
<
0
){
LeaveCriticalSection
(
&
This
->
lock
);
...
...
@@ -1600,6 +1608,10 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
LeaveCriticalSection
(
&
This
->
lock
);
if
(
event
&&
wait
)
WaitForSingleObject
(
event
,
INFINITE
);
CloseHandle
(
event
);
return
S_OK
;
}
...
...
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