[llvm-bugs] [Bug 44773] steady_clock not advancing after system resumes

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 13 07:47:20 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=44773

Louis Dionne <ldionne at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
 Fixed By Commit(s)|                            |8bec8927134f116eb11ddea9db7
                   |                            |8b1a6241884c9
         Resolution|---                         |FIXED

--- Comment #2 from Louis Dionne <ldionne at apple.com> ---
This was fixed with

    commit 8bec8927134f116eb11ddea9db78b1a6241884c9
    Author: Louis Dionne <ldionne at apple.com>
    Date:   Mon Feb 10 18:30:43 2020 +0100

        [libc++][Apple] Use CLOCK_MONOTONIC_RAW instead of CLOCK_UPTIME_RAW for
steady_clock

        Summary:
        In D27429, we switched the Apple implementation of steady_clock::now()
        from clock_gettime(CLOCK_MONOTONIC) to clock_gettime(CLOCK_UPTIME_RAW).
        The purpose was to get nanosecond precision, and also to improve the
        performance of the implementation.

        However, it appears that CLOCK_UPTIME_RAW does not satisfy the
requirements
        of the Standard, since it is not strictly speaking monotonic. Indeed,
the
        clock does not increment while the system is asleep, which had been
        mentioned in D27429 but somehow not addressed.

        This patch switches to CLOCK_MONOTONIC_RAW, which is monotonic,
increased
        during sleep, and also has nanosecond precision.

        https://llvm.org/PR44773

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201013/de2dc069/attachment.html>


More information about the llvm-bugs mailing list