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
a9dd37be
Commit
a9dd37be
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: Implement TpCallbackLeaveCriticalSectionOnCompletion.
An instance can only have one completion of each type, trying to add a second one leads to an exception on Windows.
parent
eb974bcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
threadpool.c
dlls/ntdll/threadpool.c
+24
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
a9dd37be
...
...
@@ -973,6 +973,7 @@
@ stdcall TpAllocCleanupGroup(ptr)
@ stdcall TpAllocPool(ptr ptr)
@ stdcall TpAllocWork(ptr ptr ptr ptr)
@ stdcall TpCallbackLeaveCriticalSectionOnCompletion(ptr ptr)
@ stdcall TpCallbackMayRunLong(ptr)
@ stdcall TpPostWork(ptr)
@ stdcall TpReleaseCleanupGroup(ptr)
...
...
dlls/ntdll/threadpool.c
View file @
a9dd37be
...
...
@@ -203,6 +203,10 @@ struct threadpool_instance
struct
threadpool_object
*
object
;
DWORD
threadid
;
BOOL
may_run_long
;
struct
{
CRITICAL_SECTION
*
critical_section
;
}
cleanup
;
};
/* internal threadpool group representation */
...
...
@@ -1630,6 +1634,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
instance
.
object
=
object
;
instance
.
threadid
=
GetCurrentThreadId
();
instance
.
may_run_long
=
object
->
may_run_long
;
instance
.
cleanup
.
critical_section
=
NULL
;
switch
(
object
->
type
)
{
...
...
@@ -1665,6 +1670,12 @@ static void CALLBACK threadpool_worker_proc( void *param )
TRACE
(
"callback %p returned
\n
"
,
object
->
finalization_callback
);
}
/* Execute cleanup tasks. */
if
(
instance
.
cleanup
.
critical_section
)
{
RtlLeaveCriticalSection
(
instance
.
cleanup
.
critical_section
);
}
RtlEnterCriticalSection
(
&
pool
->
cs
);
pool
->
num_busy_workers
--
;
object
->
num_running_callbacks
--
;
...
...
@@ -1753,6 +1764,19 @@ NTSTATUS WINAPI TpAllocWork( TP_WORK **out, PTP_WORK_CALLBACK callback, PVOID us
}
/***********************************************************************
* TpCallbackLeaveCriticalSectionOnCompletion (NTDLL.@)
*/
VOID
WINAPI
TpCallbackLeaveCriticalSectionOnCompletion
(
TP_CALLBACK_INSTANCE
*
instance
,
CRITICAL_SECTION
*
crit
)
{
struct
threadpool_instance
*
this
=
impl_from_TP_CALLBACK_INSTANCE
(
instance
);
TRACE
(
"%p %p
\n
"
,
instance
,
crit
);
if
(
!
this
->
cleanup
.
critical_section
)
this
->
cleanup
.
critical_section
=
crit
;
}
/***********************************************************************
* TpCallbackMayRunLong (NTDLL.@)
*/
NTSTATUS
WINAPI
TpCallbackMayRunLong
(
TP_CALLBACK_INSTANCE
*
instance
)
...
...
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