Skip to content

VS 2019 16.8 Preview 4, Python 3.9.0, absolute time fix - #1371

Merged
Stephan T. Lavavej (StephanTLavavej) merged 8 commits into
microsoft:masterfrom
StephanTLavavej:vs-2019-16.8-p4
Oct 17, 2020
Merged

VS 2019 16.8 Preview 4, Python 3.9.0, absolute time fix#1371
Stephan T. Lavavej (StephanTLavavej) merged 8 commits into
microsoft:masterfrom
StephanTLavavej:vs-2019-16.8-p4

Conversation

@StephanTLavavej

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) commented Oct 14, 2020

Copy link
Copy Markdown
Member

This updates the CI infrastructure to VS 2019 16.8 Preview 4 and Python 3.9.0.

This also fixes #1365, a sporadic test failure that I encountered after upgrading my local machine to Python 3.9.0. (I'm still not sure if they're actually related, but I've bundled these changes together since they affect different files and are relatively small.) Matt Stephanson (@MattStephanson) found the root cause and Casey Carter (@CaseyCarter) developed a fix: convert relative time to absolute time, clamped between now and forever. I then made the following changes:

  • Move _To_absolute_time up to <thread> so we can fix 3 more lines (in <thread> and <shared_mutex>).
  • _To_absolute_time is a template, so we don't need inline.
  • The return type needs special attention - we want to return the same type as now() + _Rel_time (the expression we're replacing and clamping). For example, this makes a difference when _Rel_time has a double representation.
  • Extract constexpr _Zero to avoid a function call in debug mode.
  • Similarly, upgrade _Forever to constexpr.

... without overflow by saturating on the high end and clipping to `now`.
* This is a template, so we don't need inline.
* Use auto for _Abs_time - its type is unsurprising.
* Extract constexpr _Zero to avoid a function call in debug mode.
* Similarly, upgrade _Forever to constexpr.
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added bug Something isn't working infrastructure Related to repository automation labels Oct 14, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@StephanTLavavej

Copy link
Copy Markdown
Member Author

Thanks again Matt Stephanson (@MattStephanson) and Casey Carter (@CaseyCarter)! 😺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure Related to repository automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sporadic failure of P0660R10_jthread_and_cv_any

5 participants