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
3d43a629
Commit
3d43a629
authored
Jun 15, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Have thread safety in memallocator.
parent
dae09d00
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
memallocator.c
dlls/quartz/memallocator.c
+14
-7
No files found.
dlls/quartz/memallocator.c
View file @
3d43a629
...
@@ -257,7 +257,8 @@ static HRESULT WINAPI BaseMemAllocator_Decommit(IMemAllocator * iface)
...
@@ -257,7 +257,8 @@ static HRESULT WINAPI BaseMemAllocator_Decommit(IMemAllocator * iface)
}
}
else
else
{
{
assert
(
This
->
lWaiting
==
0
);
if
(
This
->
lWaiting
!=
0
)
ERR
(
"Waiting: %d
\n
"
,
This
->
lWaiting
);
This
->
bCommitted
=
FALSE
;
This
->
bCommitted
=
FALSE
;
CloseHandle
(
This
->
hSemWaiting
);
CloseHandle
(
This
->
hSemWaiting
);
...
@@ -286,19 +287,24 @@ static HRESULT WINAPI BaseMemAllocator_GetBuffer(IMemAllocator * iface, IMediaSa
...
@@ -286,19 +287,24 @@ static HRESULT WINAPI BaseMemAllocator_GetBuffer(IMemAllocator * iface, IMediaSa
*
pSample
=
NULL
;
*
pSample
=
NULL
;
if
(
!
This
->
bCommitted
)
EnterCriticalSection
(
This
->
pCritSect
);
return
VFW_E_NOT_COMMITTED
;
if
(
!
This
->
bCommitted
||
This
->
bDecommitQueued
)
hr
=
VFW_E_NOT_COMMITTED
;
else
++
This
->
lWaiting
;
LeaveCriticalSection
(
This
->
pCritSect
);
if
(
FAILED
(
hr
))
return
hr
;
This
->
lWaiting
++
;
if
(
WaitForSingleObject
(
This
->
hSemWaiting
,
(
dwFlags
&
AM_GBF_NOWAIT
)
?
0
:
INFINITE
)
!=
WAIT_OBJECT_0
)
if
(
WaitForSingleObject
(
This
->
hSemWaiting
,
(
dwFlags
&
AM_GBF_NOWAIT
)
?
0
:
INFINITE
)
!=
WAIT_OBJECT_0
)
{
{
This
->
lWaiting
--
;
InterlockedDecrement
(
&
This
->
lWaiting
)
;
return
VFW_E_TIMEOUT
;
return
VFW_E_TIMEOUT
;
}
}
This
->
lWaiting
--
;
EnterCriticalSection
(
This
->
pCritSect
);
EnterCriticalSection
(
This
->
pCritSect
);
{
{
--
This
->
lWaiting
;
if
(
!
This
->
bCommitted
)
if
(
!
This
->
bCommitted
)
hr
=
VFW_E_NOT_COMMITTED
;
hr
=
VFW_E_NOT_COMMITTED
;
else
if
(
This
->
bDecommitQueued
)
else
if
(
This
->
bDecommitQueued
)
...
@@ -347,7 +353,8 @@ static HRESULT WINAPI BaseMemAllocator_ReleaseBuffer(IMemAllocator * iface, IMed
...
@@ -347,7 +353,8 @@ static HRESULT WINAPI BaseMemAllocator_ReleaseBuffer(IMemAllocator * iface, IMed
{
{
HRESULT
hrfree
;
HRESULT
hrfree
;
assert
(
This
->
lWaiting
==
0
);
if
(
This
->
lWaiting
!=
0
)
ERR
(
"Waiting: %d
\n
"
,
This
->
lWaiting
);
This
->
bCommitted
=
FALSE
;
This
->
bCommitted
=
FALSE
;
This
->
bDecommitQueued
=
FALSE
;
This
->
bDecommitQueued
=
FALSE
;
...
...
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