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
1839ce86
Commit
1839ce86
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 group cancel callback.
parent
388da78e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
threadpool.c
dlls/ntdll/threadpool.c
+14
-3
No files found.
dlls/ntdll/threadpool.c
View file @
1839ce86
...
...
@@ -171,6 +171,7 @@ struct threadpool_object
struct
threadpool
*
pool
;
struct
threadpool_group
*
group
;
PVOID
userdata
;
PTP_CLEANUP_GROUP_CANCEL_CALLBACK
group_cancel_callback
;
/* information about the group, locked via .group->cs */
struct
list
group_entry
;
BOOL
is_group_member
;
...
...
@@ -1370,6 +1371,7 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
object
->
pool
=
pool
;
object
->
group
=
NULL
;
object
->
userdata
=
userdata
;
object
->
group_cancel_callback
=
NULL
;
memset
(
&
object
->
group_entry
,
0
,
sizeof
(
object
->
group_entry
)
);
object
->
is_group_member
=
FALSE
;
...
...
@@ -1385,6 +1387,7 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
FIXME
(
"unsupported environment version %u
\n
"
,
environment
->
Version
);
object
->
group
=
impl_from_TP_CLEANUP_GROUP
(
environment
->
CleanupGroup
);
object
->
group_cancel_callback
=
environment
->
CleanupGroupCancelCallback
;
WARN
(
"environment not fully implemented yet
\n
"
);
}
...
...
@@ -1467,7 +1470,7 @@ static void tp_object_submit( struct threadpool_object *object )
*
* Cancels all currently pending callbacks for a specific object.
*/
static
void
tp_object_cancel
(
struct
threadpool_object
*
object
)
static
void
tp_object_cancel
(
struct
threadpool_object
*
object
,
BOOL
group_cancel
,
PVOID
userdata
)
{
struct
threadpool
*
pool
=
object
->
pool
;
LONG
pending_callbacks
=
0
;
...
...
@@ -1481,6 +1484,14 @@ static void tp_object_cancel( struct threadpool_object *object )
}
RtlLeaveCriticalSection
(
&
pool
->
cs
);
/* Execute group cancellation callback if defined, and if this was actually a group cancel. */
if
(
pending_callbacks
&&
group_cancel
&&
object
->
group_cancel_callback
)
{
TRACE
(
"executing group cancel callback %p(%p, %p)
\n
"
,
object
->
group_cancel_callback
,
object
,
userdata
);
object
->
group_cancel_callback
(
object
,
userdata
);
TRACE
(
"callback %p returned
\n
"
,
object
->
group_cancel_callback
);
}
while
(
pending_callbacks
--
)
tp_object_release
(
object
);
}
...
...
@@ -1766,7 +1777,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
{
LIST_FOR_EACH_ENTRY
(
object
,
&
members
,
struct
threadpool_object
,
group_entry
)
{
tp_object_cancel
(
object
);
tp_object_cancel
(
object
,
TRUE
,
userdata
);
}
}
...
...
@@ -1894,6 +1905,6 @@ VOID WINAPI TpWaitForWork( TP_WORK *work, BOOL cancel_pending )
TRACE
(
"%p %u
\n
"
,
work
,
cancel_pending
);
if
(
cancel_pending
)
tp_object_cancel
(
this
);
tp_object_cancel
(
this
,
FALSE
,
NULL
);
tp_object_wait
(
this
);
}
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