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
8099c2b9
Commit
8099c2b9
authored
Nov 02, 2004
by
Jeremy White
Committed by
Alexandre Julliard
Nov 02, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tune the behavior of Sleep() and Waitxxx() to more closely resemble
Windows behavior. The key is to yield in a Sleep and in any Wait that times out.
parent
49a5036c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
sync.c
dlls/ntdll/sync.c
+13
-5
No files found.
dlls/ntdll/sync.c
View file @
8099c2b9
...
...
@@ -586,6 +586,12 @@ NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UIN
call_apcs
(
(
flags
&
SELECT_ALERTABLE
)
!=
0
);
if
(
flags
&
SELECT_ALERTABLE
)
break
;
}
/* A test on Windows 2000 shows that Windows always yields during
a wait, but a wait that is hit by an event gets a priority
boost as well. This seems to model that behavior the closest. */
if
(
ret
==
WAIT_TIMEOUT
)
NtYieldExecution
();
return
ret
;
}
...
...
@@ -649,15 +655,15 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou
{
for
(;;)
select
(
0
,
NULL
,
NULL
,
NULL
,
NULL
);
}
else
if
(
!
timeout
->
QuadPart
)
{
NtYieldExecution
();
}
else
{
abs_time_t
when
;
NTDLL_get_server_timeout
(
&
when
,
timeout
);
/* Note that we yield after establishing the desired timeout */
NtYieldExecution
();
for
(;;)
{
struct
timeval
tv
;
...
...
@@ -668,7 +674,9 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou
tv
.
tv_usec
+=
1000000
;
tv
.
tv_sec
--
;
}
if
(
tv
.
tv_sec
<
0
)
tv
.
tv_sec
=
tv
.
tv_usec
=
0
;
/* if our yield already passed enough time, we're done */
if
(
tv
.
tv_sec
<
0
)
break
;
if
(
select
(
0
,
NULL
,
NULL
,
NULL
,
&
tv
)
!=
-
1
)
break
;
}
}
...
...
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