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
7d9ec31e
Commit
7d9ec31e
authored
Jul 01, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement TpSetPoolMinThreads.
parent
d56984a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
threadpool.c
dlls/ntdll/threadpool.c
+35
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
7d9ec31e
...
...
@@ -973,6 +973,7 @@
@ stdcall TpAllocPool(ptr ptr)
@ stdcall TpReleasePool(ptr)
@ stdcall TpSetPoolMaxThreads(ptr long)
@ stdcall TpSetPoolMinThreads(ptr long)
@ stdcall TpSimpleTryPost(ptr ptr ptr)
@ stdcall -ret64 VerSetConditionMask(int64 long long)
@ stdcall WinSqmIsOptedIn()
...
...
dlls/ntdll/threadpool.c
View file @
7d9ec31e
...
...
@@ -1481,6 +1481,41 @@ VOID WINAPI TpSetPoolMaxThreads( TP_POOL *pool, DWORD maximum )
}
/***********************************************************************
* TpSetPoolMinThreads (NTDLL.@)
*/
BOOL
WINAPI
TpSetPoolMinThreads
(
TP_POOL
*
pool
,
DWORD
minimum
)
{
struct
threadpool
*
this
=
impl_from_TP_POOL
(
pool
);
NTSTATUS
status
=
STATUS_SUCCESS
;
TRACE
(
"%p %u
\n
"
,
pool
,
minimum
);
RtlEnterCriticalSection
(
&
this
->
cs
);
while
(
this
->
num_workers
<
minimum
)
{
HANDLE
thread
;
status
=
RtlCreateUserThread
(
GetCurrentProcess
(),
NULL
,
FALSE
,
NULL
,
0
,
0
,
threadpool_worker_proc
,
this
,
&
thread
,
NULL
);
if
(
status
!=
STATUS_SUCCESS
)
break
;
interlocked_inc
(
&
this
->
refcount
);
this
->
num_workers
++
;
NtClose
(
thread
);
}
if
(
status
==
STATUS_SUCCESS
)
{
this
->
min_workers
=
minimum
;
this
->
max_workers
=
max
(
this
->
min_workers
,
this
->
max_workers
);
}
RtlLeaveCriticalSection
(
&
this
->
cs
);
return
!
status
;
}
/***********************************************************************
* TpSimpleTryPost (NTDLL.@)
*/
NTSTATUS
WINAPI
TpSimpleTryPost
(
PTP_SIMPLE_CALLBACK
callback
,
PVOID
userdata
,
...
...
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