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
18524757
Commit
18524757
authored
Jul 05, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement TpSetWait and TpWaitForWait.
parent
f1be5dca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
0 deletions
+77
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
threadpool.c
dlls/ntdll/threadpool.c
+75
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
18524757
...
...
@@ -993,8 +993,10 @@
@ stdcall TpSetPoolMaxThreads(ptr long)
@ stdcall TpSetPoolMinThreads(ptr long)
@ stdcall TpSetTimer(ptr ptr long long)
@ stdcall TpSetWait(ptr long ptr)
@ stdcall TpSimpleTryPost(ptr ptr ptr)
@ stdcall TpWaitForTimer(ptr long)
@ stdcall TpWaitForWait(ptr long)
@ stdcall TpWaitForWork(ptr long)
@ stdcall -ret64 VerSetConditionMask(int64 long long)
@ stdcall WinSqmIsOptedIn()
...
...
dlls/ntdll/threadpool.c
View file @
18524757
...
...
@@ -2836,6 +2836,67 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
}
/***********************************************************************
* TpSetWait (NTDLL.@)
*/
VOID
WINAPI
TpSetWait
(
TP_WAIT
*
wait
,
HANDLE
handle
,
LARGE_INTEGER
*
timeout
)
{
struct
threadpool_object
*
this
=
impl_from_TP_WAIT
(
wait
);
ULONGLONG
timestamp
=
TIMEOUT_INFINITE
;
BOOL
submit_wait
=
FALSE
;
TRACE
(
"%p %p %p
\n
"
,
wait
,
handle
,
timeout
);
RtlEnterCriticalSection
(
&
waitqueue
.
cs
);
assert
(
this
->
u
.
wait
.
bucket
);
this
->
u
.
wait
.
handle
=
handle
;
if
(
handle
||
this
->
u
.
wait
.
wait_pending
)
{
struct
waitqueue_bucket
*
bucket
=
this
->
u
.
wait
.
bucket
;
list_remove
(
&
this
->
u
.
wait
.
wait_entry
);
/* Convert relative timeout to absolute timestamp. */
if
(
handle
&&
timeout
)
{
timestamp
=
timeout
->
QuadPart
;
if
((
LONGLONG
)
timestamp
<
0
)
{
LARGE_INTEGER
now
;
NtQuerySystemTime
(
&
now
);
timestamp
=
now
.
QuadPart
-
timestamp
;
}
else
if
(
!
timestamp
)
{
submit_wait
=
TRUE
;
handle
=
NULL
;
}
}
/* Add wait object back into one of the queues. */
if
(
handle
)
{
list_add_tail
(
&
bucket
->
waiting
,
&
this
->
u
.
wait
.
wait_entry
);
this
->
u
.
wait
.
wait_pending
=
TRUE
;
this
->
u
.
wait
.
timeout
=
timestamp
;
}
else
{
list_add_tail
(
&
bucket
->
reserved
,
&
this
->
u
.
wait
.
wait_entry
);
this
->
u
.
wait
.
wait_pending
=
FALSE
;
}
/* Wake up the wait queue thread. */
NtSetEvent
(
bucket
->
update_event
,
NULL
);
}
RtlLeaveCriticalSection
(
&
waitqueue
.
cs
);
if
(
submit_wait
)
tp_object_submit
(
this
,
FALSE
);
}
/***********************************************************************
* TpSimpleTryPost (NTDLL.@)
*/
NTSTATUS
WINAPI
TpSimpleTryPost
(
PTP_SIMPLE_CALLBACK
callback
,
PVOID
userdata
,
...
...
@@ -2880,6 +2941,20 @@ VOID WINAPI TpWaitForTimer( TP_TIMER *timer, BOOL cancel_pending )
}
/***********************************************************************
* TpWaitForWait (NTDLL.@)
*/
VOID
WINAPI
TpWaitForWait
(
TP_WAIT
*
wait
,
BOOL
cancel_pending
)
{
struct
threadpool_object
*
this
=
impl_from_TP_WAIT
(
wait
);
TRACE
(
"%p %d
\n
"
,
wait
,
cancel_pending
);
if
(
cancel_pending
)
tp_object_cancel
(
this
,
FALSE
,
NULL
);
tp_object_wait
(
this
,
FALSE
);
}
/***********************************************************************
* TpWaitForWork (NTDLL.@)
*/
VOID
WINAPI
TpWaitForWork
(
TP_WORK
*
work
,
BOOL
cancel_pending
)
...
...
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