This repository has been archived by the owner on May 4, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
windows: deal with the fact that GetTickCount might lag
We use GetQueuedCompletionStatus(Ex) to sleep the thread until the next timer expires (provided that no other events happen before that). However after waking up from a sleep the GetTickCount() return value may not immediately reflect that some time has passed. This happens because gqcs can sometimes sleep for periods shorter than the GetTickCount clock resulution. This patch changes time tracking so the amount of time waited by gqcs is taken into account. This has the following advantages: * Excessive loop iterations are avoided. * Small timeouts are fired more precisely. * The `loop-stop` test that used to be flaky on Windows now passes consistently.
- Loading branch information
1 parent
79f9629
commit 579609e
Showing
4 changed files
with
42 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters