Skip to content

shims: use the precise Windows time functions #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2019
Merged

shims: use the precise Windows time functions #498

merged 1 commit into from
Jun 13, 2019

Conversation

adierking
Copy link
Contributor

_dispatch_uptime() and _dispatch_monotonic_time() are currently
using interrupt time APIs which return values cached by the scheduler.
This is causing the dispatch_after test to fail on Windows. Switch them
to the "Precise" APIs which incorporate a hardware time reading into
their results. Unfortunately, these functions are not exported by any
import libraries and we have to locate them at runtime.

Also, _dispatch_monotonic_time() should not be using the unbiased
version of the API because it is expected to include suspend time.

`_dispatch_uptime()` and `_dispatch_monotonic_time()` are currently
using interrupt time APIs which return values cached by the scheduler.
This is causing the dispatch_after test to fail on Windows. Switch them
to the "Precise" APIs which incorporate a hardware time reading into
their results. Unfortunately, these functions are not exported by any
import libraries and we have to locate them at runtime.

Also, `_dispatch_monotonic_time()` should not be using the unbiased
version of the API because it is expected to include suspend time.
@adierking
Copy link
Contributor Author

cc @compnerd @ktopley-apple

@compnerd
Copy link
Member

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ktopley-apple ktopley-apple merged commit 52bc6b2 into swiftlang:master Jun 13, 2019
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
shims: use the precise Windows time functions
Signed-off-by: Kim Topley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants