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
6f2b0fbf
Commit
6f2b0fbf
authored
Mar 21, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Mar 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Add a test for QueueUserWorkItem.
parent
264b122d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
thread.c
dlls/kernel/tests/thread.c
+37
-0
No files found.
dlls/kernel/tests/thread.c
View file @
6f2b0fbf
...
...
@@ -677,6 +677,42 @@ static void test_SetThreadContext(void)
#endif
/* __i386__ */
static
HANDLE
finish_event
;
static
LONG
times_executed
;
static
DWORD
CALLBACK
work_function
(
void
*
p
)
{
LONG
executed
=
InterlockedIncrement
(
&
times_executed
);
if
(
executed
==
100
)
SetEvent
(
finish_event
);
return
0
;
}
static
void
test_QueueUserWorkItem
(
void
)
{
int
i
;
DWORD
wait_result
;
DWORD
before
,
after
;
finish_event
=
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
NULL
);
before
=
GetTickCount
();
for
(
i
=
0
;
i
<
100
;
i
++
)
{
BOOL
ret
=
QueueUserWorkItem
(
work_function
,
(
void
*
)
i
,
WT_EXECUTEDEFAULT
);
ok
(
ret
,
"QueueUserWorkItem failed with error %ld
\n
"
,
GetLastError
());
}
wait_result
=
WaitForSingleObject
(
finish_event
,
10000
);
after
=
GetTickCount
();
trace
(
"100 QueueUserWorkItem calls took %ldms
\n
"
,
after
-
before
);
ok
(
wait_result
==
WAIT_OBJECT_0
,
"wait failed with error 0x%lx
\n
"
,
wait_result
);
ok
(
times_executed
==
100
,
"didn't execute all of the work items
\n
"
);
}
START_TEST
(
thread
)
{
...
...
@@ -702,4 +738,5 @@ START_TEST(thread)
#ifdef __i386__
test_SetThreadContext
();
#endif
test_QueueUserWorkItem
();
}
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