Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5bd9d580
Commit
5bd9d580
authored
Jul 29, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Mark newly spawned worker threads as busy.
parent
e48c3e46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
threadpool.c
dlls/ntdll/threadpool.c
+7
-0
No files found.
dlls/ntdll/threadpool.c
View file @
5bd9d580
...
@@ -379,6 +379,8 @@ NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context
...
@@ -379,6 +379,8 @@ NTSTATUS WINAPI RtlQueueWorkItem( PRTL_WORK_ITEM_ROUTINE function, PVOID context
struct
rtl_work_item
*
item
;
struct
rtl_work_item
*
item
;
NTSTATUS
status
;
NTSTATUS
status
;
TRACE
(
"%p %p %u
\n
"
,
function
,
context
,
flags
);
item
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
item
)
);
item
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
item
)
);
if
(
!
item
)
if
(
!
item
)
return
STATUS_NO_MEMORY
;
return
STATUS_NO_MEMORY
;
...
@@ -1716,6 +1718,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
...
@@ -1716,6 +1718,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
{
{
interlocked_inc
(
&
pool
->
refcount
);
interlocked_inc
(
&
pool
->
refcount
);
pool
->
num_workers
++
;
pool
->
num_workers
++
;
pool
->
num_busy_workers
++
;
NtClose
(
thread
);
NtClose
(
thread
);
}
}
}
}
...
@@ -1915,6 +1918,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
...
@@ -1915,6 +1918,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
{
{
interlocked_inc
(
&
pool
->
refcount
);
interlocked_inc
(
&
pool
->
refcount
);
pool
->
num_workers
++
;
pool
->
num_workers
++
;
pool
->
num_busy_workers
++
;
NtClose
(
thread
);
NtClose
(
thread
);
}
}
}
}
...
@@ -2070,6 +2074,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
...
@@ -2070,6 +2074,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
TRACE
(
"starting worker thread for pool %p
\n
"
,
pool
);
TRACE
(
"starting worker thread for pool %p
\n
"
,
pool
);
RtlEnterCriticalSection
(
&
pool
->
cs
);
RtlEnterCriticalSection
(
&
pool
->
cs
);
pool
->
num_busy_workers
--
;
for
(;;)
for
(;;)
{
{
while
((
ptr
=
list_head
(
&
pool
->
pool
)))
while
((
ptr
=
list_head
(
&
pool
->
pool
)))
...
@@ -2412,6 +2417,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
...
@@ -2412,6 +2417,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
{
{
interlocked_inc
(
&
pool
->
refcount
);
interlocked_inc
(
&
pool
->
refcount
);
pool
->
num_workers
++
;
pool
->
num_workers
++
;
pool
->
num_busy_workers
++
;
NtClose
(
thread
);
NtClose
(
thread
);
}
}
}
}
...
@@ -2699,6 +2705,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
...
@@ -2699,6 +2705,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
interlocked_inc
(
&
this
->
refcount
);
interlocked_inc
(
&
this
->
refcount
);
this
->
num_workers
++
;
this
->
num_workers
++
;
this
->
num_busy_workers
++
;
NtClose
(
thread
);
NtClose
(
thread
);
}
}
...
...
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