Skip to content
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

Make ftime return wall clock #4

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Commits on Feb 22, 2022

  1. Change ftime so it returns wall clock

    Return wall clock on calling `ftime`, since the
    function is used in `pte_relmillisecs` to find
    the time offset as milliseconds from the current
    system time.
    
    `pte_relmillisecs` returns timeout as milliseconds
    from current system time, got by calling `ftime`.
    `sem_timedwait` calculates the time offset using
    `pte_relmillisecs` and then waits in a loop.
    
    Using monotonic time results in a wrong offset
    when using `sem_timedwait` that makes the `abstime`
    argument be interpreted as a relative offset to
    the monotonic clock start, not as an absolute value
    since epoch.
    
    Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
    StefanJum committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    e64ca30 View commit details
    Browse the repository at this point in the history