KEMBAR78
`<semaphore>`: use `steady_clock` by AlexGuteniev · Pull Request #5575 · microsoft/STL · GitHub
Skip to content

Conversation

AlexGuteniev
Copy link
Contributor

Fixes #5574

Abandon __std_atomic_wait_get_deadline and __std_atomic_wait_get_remaining_timeout. Originally they were used as fast and convenient steady clock, that is just as precise as the wait itself. But we have to use the steady_clock, not a steady clock, and be as precise as it is.

No need in _Clamped_rel_time_ms_count. The existing _Semaphore_remaining_timeout is good enough, although it diverges in that it clamps to 10 days, not to 1 day. Importantly. both use chrono::ceil to get larger rather than smaller timeout when rounding.

@AlexGuteniev AlexGuteniev requested a review from a team as a code owner June 7, 2025 04:21
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Jun 7, 2025
@StephanTLavavej StephanTLavavej added bug Something isn't working chrono C++20 chrono labels Jun 8, 2025
@StephanTLavavej StephanTLavavej self-assigned this Jun 8, 2025
@StephanTLavavej StephanTLavavej removed their assignment Jun 10, 2025
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Jun 10, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Jun 11, 2025
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 313964b into microsoft:main Jun 14, 2025
48 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Jun 14, 2025
@StephanTLavavej
Copy link
Member

🚦 ⏱️ ⚖️

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

Labels

bug Something isn't working chrono C++20 chrono

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

<semaphore>: counting_semaphore::try_acquire_for() does not block long enough for shorter durations

2 participants