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
eb39cb13
Commit
eb39cb13
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 TpCallbackReleaseSemaphoreOnCompletion.
parent
02ee5bb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
threadpool.c
dlls/ntdll/threadpool.c
+28
-1
No files found.
dlls/ntdll/ntdll.spec
View file @
eb39cb13
...
...
@@ -976,6 +976,7 @@
@ stdcall TpCallbackLeaveCriticalSectionOnCompletion(ptr ptr)
@ stdcall TpCallbackMayRunLong(ptr)
@ stdcall TpCallbackReleaseMutexOnCompletion(ptr long)
@ stdcall TpCallbackReleaseSemaphoreOnCompletion(ptr long long)
@ stdcall TpPostWork(ptr)
@ stdcall TpReleaseCleanupGroup(ptr)
@ stdcall TpReleaseCleanupGroupMembers(ptr long ptr)
...
...
dlls/ntdll/threadpool.c
View file @
eb39cb13
...
...
@@ -207,6 +207,8 @@ struct threadpool_instance
{
CRITICAL_SECTION
*
critical_section
;
HANDLE
mutex
;
HANDLE
semaphore
;
LONG
semaphore_count
;
}
cleanup
;
};
...
...
@@ -1608,6 +1610,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
struct
threadpool
*
pool
=
param
;
LARGE_INTEGER
timeout
;
struct
list
*
ptr
;
NTSTATUS
status
;
TRACE
(
"starting worker thread for pool %p
\n
"
,
pool
);
...
...
@@ -1637,6 +1640,8 @@ static void CALLBACK threadpool_worker_proc( void *param )
instance
.
may_run_long
=
object
->
may_run_long
;
instance
.
cleanup
.
critical_section
=
NULL
;
instance
.
cleanup
.
mutex
=
NULL
;
instance
.
cleanup
.
semaphore
=
NULL
;
instance
.
cleanup
.
semaphore_count
=
0
;
switch
(
object
->
type
)
{
...
...
@@ -1679,9 +1684,15 @@ static void CALLBACK threadpool_worker_proc( void *param )
}
if
(
instance
.
cleanup
.
mutex
)
{
NtReleaseMutant
(
instance
.
cleanup
.
mutex
,
NULL
);
status
=
NtReleaseMutant
(
instance
.
cleanup
.
mutex
,
NULL
);
if
(
status
!=
STATUS_SUCCESS
)
goto
skip_cleanup
;
}
if
(
instance
.
cleanup
.
semaphore
)
{
NtReleaseSemaphore
(
instance
.
cleanup
.
semaphore
,
instance
.
cleanup
.
semaphore_count
,
NULL
);
}
skip_cleanup:
RtlEnterCriticalSection
(
&
pool
->
cs
);
pool
->
num_busy_workers
--
;
object
->
num_running_callbacks
--
;
...
...
@@ -1846,6 +1857,22 @@ VOID WINAPI TpCallbackReleaseMutexOnCompletion( TP_CALLBACK_INSTANCE *instance,
}
/***********************************************************************
* TpCallbackReleaseSemaphoreOnCompletion (NTDLL.@)
*/
VOID
WINAPI
TpCallbackReleaseSemaphoreOnCompletion
(
TP_CALLBACK_INSTANCE
*
instance
,
HANDLE
semaphore
,
DWORD
count
)
{
struct
threadpool_instance
*
this
=
impl_from_TP_CALLBACK_INSTANCE
(
instance
);
TRACE
(
"%p %p %u
\n
"
,
instance
,
semaphore
,
count
);
if
(
!
this
->
cleanup
.
semaphore
)
{
this
->
cleanup
.
semaphore
=
semaphore
;
this
->
cleanup
.
semaphore_count
=
count
;
}
}
/***********************************************************************
* TpPostWork (NTDLL.@)
*/
VOID
WINAPI
TpPostWork
(
TP_WORK
*
work
)
...
...
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