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
5ef54c4c
Commit
5ef54c4c
authored
Jul 24, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement the timer queue thread.
parent
6de5bdb0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
291 additions
and
17 deletions
+291
-17
sync.c
dlls/kernel32/tests/sync.c
+29
-5
threadpool.c
dlls/ntdll/threadpool.c
+262
-12
No files found.
dlls/kernel32/tests/sync.c
View file @
5ef54c4c
...
@@ -588,11 +588,29 @@ static void CALLBACK timer_queue_cb3(PVOID p, BOOLEAN timedOut)
...
@@ -588,11 +588,29 @@ static void CALLBACK timer_queue_cb3(PVOID p, BOOLEAN timedOut)
}
}
}
}
static
void
CALLBACK
timer_queue_cb4
(
PVOID
p
,
BOOLEAN
timedOut
)
{
struct
timer_queue_data1
*
d
=
p
;
ok
(
timedOut
,
"Timer callbacks should always time out
\n
"
);
if
(
d
->
t
)
{
/* This tests whether a timer gets flagged for deletion before
or after the callback runs. If we start this timer with a
period of zero (run once), then ChangeTimerQueueTimer will
fail if the timer is already flagged. Hence we really run
only once. Otherwise we will run multiple times. */
BOOL
ret
=
pChangeTimerQueueTimer
(
d
->
q
,
d
->
t
,
50
,
50
);
todo_wine
ok
(
ret
,
"ChangeTimerQueueTimer
\n
"
);
++
d
->
num_calls
;
}
}
static
void
test_timer_queue
(
void
)
static
void
test_timer_queue
(
void
)
{
{
HANDLE
q
,
t1
,
t2
,
t3
,
t4
,
t5
;
HANDLE
q
,
t1
,
t2
,
t3
,
t4
,
t5
;
int
n1
,
n2
,
n3
,
n4
,
n5
;
int
n1
,
n2
,
n3
,
n4
,
n5
;
struct
timer_queue_data1
d2
,
d3
;
struct
timer_queue_data1
d2
,
d3
,
d4
;
HANDLE
e
;
HANDLE
e
;
BOOL
ret
;
BOOL
ret
;
...
@@ -661,13 +679,9 @@ static void test_timer_queue(void)
...
@@ -661,13 +679,9 @@ static void test_timer_queue(void)
ret
=
pDeleteTimerQueueEx
(
q
,
INVALID_HANDLE_VALUE
);
ret
=
pDeleteTimerQueueEx
(
q
,
INVALID_HANDLE_VALUE
);
ok
(
ret
,
"DeleteTimerQueueEx
\n
"
);
ok
(
ret
,
"DeleteTimerQueueEx
\n
"
);
todo_wine
{
ok
(
n1
==
1
,
"Timer callback 1
\n
"
);
ok
(
n1
==
1
,
"Timer callback 1
\n
"
);
ok
(
n2
<
n3
,
"Timer callback 2 should be much slower than 3
\n
"
);
ok
(
n2
<
n3
,
"Timer callback 2 should be much slower than 3
\n
"
);
}
ok
(
n4
==
0
,
"Timer callback 4
\n
"
);
ok
(
n4
==
0
,
"Timer callback 4
\n
"
);
todo_wine
ok
(
n5
==
1
,
"Timer callback 5
\n
"
);
ok
(
n5
==
1
,
"Timer callback 5
\n
"
);
/* Test synchronous deletion of the queue with event trigger. */
/* Test synchronous deletion of the queue with event trigger. */
...
@@ -713,6 +727,15 @@ static void test_timer_queue(void)
...
@@ -713,6 +727,15 @@ static void test_timer_queue(void)
ok
(
ret
,
"CreateTimerQueueTimer
\n
"
);
ok
(
ret
,
"CreateTimerQueueTimer
\n
"
);
ok
(
t3
!=
NULL
,
"CreateTimerQueueTimer
\n
"
);
ok
(
t3
!=
NULL
,
"CreateTimerQueueTimer
\n
"
);
d4
.
t
=
t4
=
NULL
;
d4
.
num_calls
=
0
;
d4
.
q
=
q
;
ret
=
pCreateTimerQueueTimer
(
&
t4
,
q
,
timer_queue_cb4
,
&
d4
,
10
,
0
,
0
);
d4
.
t
=
t4
;
ok
(
ret
,
"CreateTimerQueueTimer
\n
"
);
ok
(
t4
!=
NULL
,
"CreateTimerQueueTimer
\n
"
);
Sleep
(
200
);
Sleep
(
200
);
ret
=
pDeleteTimerQueueEx
(
q
,
INVALID_HANDLE_VALUE
);
ret
=
pDeleteTimerQueueEx
(
q
,
INVALID_HANDLE_VALUE
);
...
@@ -722,6 +745,7 @@ static void test_timer_queue(void)
...
@@ -722,6 +745,7 @@ static void test_timer_queue(void)
ok
(
d2
.
num_calls
==
d2
.
max_calls
,
"DeleteTimerQueueTimer
\n
"
);
ok
(
d2
.
num_calls
==
d2
.
max_calls
,
"DeleteTimerQueueTimer
\n
"
);
ok
(
d3
.
num_calls
==
d3
.
max_calls
,
"ChangeTimerQueueTimer
\n
"
);
ok
(
d3
.
num_calls
==
d3
.
max_calls
,
"ChangeTimerQueueTimer
\n
"
);
}
}
ok
(
d4
.
num_calls
==
1
,
"Timer flagged for deletion incorrectly
\n
"
);
}
}
START_TEST
(
sync
)
START_TEST
(
sync
)
...
...
dlls/ntdll/threadpool.c
View file @
5ef54c4c
This diff is collapsed.
Click to expand it.
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