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
c774a8c3
Commit
c774a8c3
authored
Jul 26, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jul 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add basic tests for RtlQueueWorkItem.
parent
dd58fcc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
threadpool.c
dlls/ntdll/tests/threadpool.c
+47
-0
No files found.
dlls/ntdll/tests/threadpool.c
View file @
c774a8c3
...
...
@@ -98,6 +98,51 @@ static BOOL init_threadpool(void)
#undef NTDLL_GET_PROC
static
DWORD
CALLBACK
rtl_work_cb
(
void
*
userdata
)
{
HANDLE
semaphore
=
userdata
;
trace
(
"Running rtl_work callback
\n
"
);
ReleaseSemaphore
(
semaphore
,
1
,
NULL
);
return
0
;
}
static
void
test_RtlQueueWorkItem
(
void
)
{
HANDLE
semaphore
;
NTSTATUS
status
;
DWORD
result
;
semaphore
=
CreateSemaphoreA
(
NULL
,
0
,
1
,
NULL
);
ok
(
semaphore
!=
NULL
,
"CreateSemaphoreA failed %u
\n
"
,
GetLastError
());
status
=
RtlQueueWorkItem
(
rtl_work_cb
,
semaphore
,
WT_EXECUTEDEFAULT
);
ok
(
!
status
,
"RtlQueueWorkItem failed with status %x
\n
"
,
status
);
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
status
=
RtlQueueWorkItem
(
rtl_work_cb
,
semaphore
,
WT_EXECUTEINIOTHREAD
);
ok
(
!
status
,
"RtlQueueWorkItem failed with status %x
\n
"
,
status
);
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
status
=
RtlQueueWorkItem
(
rtl_work_cb
,
semaphore
,
WT_EXECUTEINPERSISTENTTHREAD
);
ok
(
!
status
,
"RtlQueueWorkItem failed with status %x
\n
"
,
status
);
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
status
=
RtlQueueWorkItem
(
rtl_work_cb
,
semaphore
,
WT_EXECUTELONGFUNCTION
);
ok
(
!
status
,
"RtlQueueWorkItem failed with status %x
\n
"
,
status
);
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
status
=
RtlQueueWorkItem
(
rtl_work_cb
,
semaphore
,
WT_TRANSFER_IMPERSONATION
);
ok
(
!
status
,
"RtlQueueWorkItem failed with status %x
\n
"
,
status
);
result
=
WaitForSingleObject
(
semaphore
,
1000
);
ok
(
result
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
result
);
CloseHandle
(
semaphore
);
}
static
void
CALLBACK
simple_cb
(
TP_CALLBACK_INSTANCE
*
instance
,
void
*
userdata
)
{
HANDLE
semaphore
=
userdata
;
...
...
@@ -1292,6 +1337,8 @@ static void test_tp_multi_wait(void)
START_TEST
(
threadpool
)
{
test_RtlQueueWorkItem
();
if
(
!
init_threadpool
())
return
;
...
...
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