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
48b713ef
Commit
48b713ef
authored
Mar 01, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Cleanup user queues.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a23e658a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
queue.c
dlls/mfplat/queue.c
+24
-22
No files found.
dlls/mfplat/queue.c
View file @
48b713ef
...
...
@@ -254,6 +254,28 @@ static HRESULT lock_user_queue(DWORD queue)
return
hr
;
}
static
void
shutdown_queue
(
struct
queue
*
queue
)
{
struct
work_item
*
item
,
*
item2
;
if
(
!
queue
->
pool
)
return
;
CloseThreadpoolCleanupGroupMembers
(
queue
->
env
.
CleanupGroup
,
TRUE
,
NULL
);
CloseThreadpool
(
queue
->
pool
);
queue
->
pool
=
NULL
;
EnterCriticalSection
(
&
queue
->
cs
);
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
item2
,
&
queue
->
pending_items
,
struct
work_item
,
entry
)
{
list_remove
(
&
item
->
entry
);
release_work_item
(
item
);
}
LeaveCriticalSection
(
&
queue
->
cs
);
DeleteCriticalSection
(
&
queue
->
cs
);
}
static
HRESULT
unlock_user_queue
(
DWORD
queue
)
{
HRESULT
hr
=
MF_E_INVALID_WORKQUEUE
;
...
...
@@ -268,6 +290,8 @@ static HRESULT unlock_user_queue(DWORD queue)
{
if
(
--
entry
->
refcount
==
0
)
{
shutdown_queue
((
struct
queue
*
)
entry
->
obj
);
heap_free
(
entry
->
obj
);
entry
->
obj
=
next_free_user_queue
;
next_free_user_queue
=
entry
;
}
...
...
@@ -277,28 +301,6 @@ static HRESULT unlock_user_queue(DWORD queue)
return
hr
;
}
static
void
shutdown_queue
(
struct
queue
*
queue
)
{
struct
work_item
*
item
,
*
item2
;
if
(
!
queue
->
pool
)
return
;
CloseThreadpoolCleanupGroupMembers
(
queue
->
env
.
CleanupGroup
,
TRUE
,
NULL
);
CloseThreadpool
(
queue
->
pool
);
queue
->
pool
=
NULL
;
EnterCriticalSection
(
&
queue
->
cs
);
LIST_FOR_EACH_ENTRY_SAFE
(
item
,
item2
,
&
queue
->
pending_items
,
struct
work_item
,
entry
)
{
list_remove
(
&
item
->
entry
);
release_work_item
(
item
);
}
LeaveCriticalSection
(
&
queue
->
cs
);
DeleteCriticalSection
(
&
queue
->
cs
);
}
void
shutdown_system_queues
(
void
)
{
unsigned
int
i
;
...
...
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