<semaphore>: use steady_clock by AlexGuteniev · Pull Request #5575 · microsoft/STL (original) (raw)

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.