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
fa114f12
Commit
fa114f12
authored
Jul 01, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for threadpool finalization callback.
parent
e8d4b403
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
threadpool.c
dlls/ntdll/threadpool.c
+12
-0
No files found.
dlls/ntdll/threadpool.c
View file @
fa114f12
...
...
@@ -172,6 +172,7 @@ struct threadpool_object
struct
threadpool_group
*
group
;
PVOID
userdata
;
PTP_CLEANUP_GROUP_CANCEL_CALLBACK
group_cancel_callback
;
PTP_SIMPLE_CALLBACK
finalization_callback
;
/* information about the group, locked via .group->cs */
struct
list
group_entry
;
BOOL
is_group_member
;
...
...
@@ -1372,6 +1373,7 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
object
->
group
=
NULL
;
object
->
userdata
=
userdata
;
object
->
group_cancel_callback
=
NULL
;
object
->
finalization_callback
=
NULL
;
memset
(
&
object
->
group_entry
,
0
,
sizeof
(
object
->
group_entry
)
);
object
->
is_group_member
=
FALSE
;
...
...
@@ -1388,6 +1390,7 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
object
->
group
=
impl_from_TP_CLEANUP_GROUP
(
environment
->
CleanupGroup
);
object
->
group_cancel_callback
=
environment
->
CleanupGroupCancelCallback
;
object
->
finalization_callback
=
environment
->
FinalizationCallback
;
WARN
(
"environment not fully implemented yet
\n
"
);
}
...
...
@@ -1616,6 +1619,15 @@ static void CALLBACK threadpool_worker_proc( void *param )
break
;
}
/* Execute finalization callback. */
if
(
object
->
finalization_callback
)
{
TRACE
(
"executing finalization callback %p(NULL, %p)
\n
"
,
object
->
finalization_callback
,
object
->
userdata
);
object
->
finalization_callback
(
NULL
,
object
->
userdata
);
TRACE
(
"callback %p returned
\n
"
,
object
->
finalization_callback
);
}
RtlEnterCriticalSection
(
&
pool
->
cs
);
pool
->
num_busy_workers
--
;
object
->
num_running_callbacks
--
;
...
...
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