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
5d58b92b
Commit
5d58b92b
authored
Jan 29, 2014
by
Marcus Meissner
Committed by
Alexandre Julliard
Feb 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Initial threadpool test.
parent
cef12abd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletion
+45
-1
thread.c
dlls/kernel32/tests/thread.c
+45
-1
No files found.
dlls/kernel32/tests/thread.c
View file @
5d58b92b
...
...
@@ -19,7 +19,7 @@
*/
/* Define _WIN32_WINNT to get SetThreadIdealProcessor on Windows */
#define _WIN32_WINNT 0x0
5
00
#define _WIN32_WINNT 0x0
6
00
#include <assert.h>
#include <stdarg.h>
...
...
@@ -82,6 +82,11 @@ static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW);
static
BOOL
(
WINAPI
*
pDeactivateActCtx
)(
DWORD
,
ULONG_PTR
);
static
BOOL
(
WINAPI
*
pGetCurrentActCtx
)(
HANDLE
*
);
static
void
(
WINAPI
*
pReleaseActCtx
)(
HANDLE
);
static
PTP_POOL
(
WINAPI
*
pCreateThreadpool
)(
PVOID
);
static
PTP_WORK
(
WINAPI
*
pCreateThreadpoolWork
)(
PTP_WORK_CALLBACK
,
PVOID
,
PTP_CALLBACK_ENVIRON
);
static
void
(
WINAPI
*
pSubmitThreadpoolWork
)(
PTP_WORK
);
static
void
(
WINAPI
*
pWaitForThreadpoolWorkCallbacks
)(
PTP_WORK
,
BOOL
);
static
void
(
WINAPI
*
pCloseThreadpoolWork
)(
PTP_WORK
);
static
HANDLE
create_target_process
(
const
char
*
arg
)
{
...
...
@@ -1599,6 +1604,37 @@ static void test_thread_actctx(void)
pReleaseActCtx
(
context
);
}
static
void
WINAPI
threadpool_workcallback
(
PTP_CALLBACK_INSTANCE
instance
,
void
*
context
,
PTP_WORK
work
)
{
int
*
foo
=
(
int
*
)
context
;
(
*
foo
)
++
;
}
static
void
test_threadpool
(
void
)
{
PTP_POOL
pool
;
PTP_WORK
work
;
int
workcalled
=
0
;
if
(
!
pCreateThreadpool
)
{
todo_wine
win_skip
(
"thread pool apis not supported.
\n
"
);
return
;
}
work
=
pCreateThreadpoolWork
(
threadpool_workcallback
,
&
workcalled
,
NULL
);
ok
(
work
!=
NULL
,
"Error %d in CreateThreadpoolWork
\n
"
,
GetLastError
());
pSubmitThreadpoolWork
(
work
);
pWaitForThreadpoolWorkCallbacks
(
work
,
FALSE
);
pCloseThreadpoolWork
(
work
);
ok
(
workcalled
==
1
,
"expected work to be called once, got %d
\n
"
,
workcalled
);
pool
=
pCreateThreadpool
(
NULL
);
todo_wine
ok
(
pool
!=
NULL
,
"CreateThreadpool failed
\n
"
);
}
static
void
init_funcs
(
void
)
{
HMODULE
hKernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
...
...
@@ -1622,6 +1658,12 @@ static void init_funcs(void)
X
(
DeactivateActCtx
);
X
(
GetCurrentActCtx
);
X
(
ReleaseActCtx
);
X
(
CreateThreadpool
);
X
(
CreateThreadpoolWork
);
X
(
SubmitThreadpoolWork
);
X
(
WaitForThreadpoolWorkCallbacks
);
X
(
CloseThreadpoolWork
);
#undef X
}
...
...
@@ -1687,4 +1729,6 @@ START_TEST(thread)
test_thread_fpu_cw
();
#endif
test_thread_actctx
();
test_threadpool
();
}
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