Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • VLC VLC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.8k
    • Issues 3.8k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 287
    • Merge requests 287
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLANVideoLAN
  • VLCVLC
  • Merge requests
  • !2366

vlc_thread: clarify the documentation about ticks on suspended machines

  • Review changes

  • Download
  • Patches
  • Plain diff
Open Steve Lhomme requested to merge robUx4/vlc:tick-now-suspend into master Aug 11, 2022
  • Overview 11
  • Commits 2
  • Pipelines 2
  • Changes 2

Based on the Linux CLOCK_MONOTONIC definition [1] the monotonic clock does not count ticks when the system is suspended.

https://www.man7.org/linux/man-pages/man3/clock_gettime.3.html

The POSIX definition of CLOCK_MONOTONIC does not mention if it should increase or not during suspend. Not sure if macOS or xxxBSD made the same choice as Linux. Apparently on some BSD (in this case macOS) it seems to be the other way around: https://www.manpagez.com/man/3/clock_gettime_nsec_np/

     CLOCK_MONOTONIC    clock that increments monotonically, tracking the time
                        since an arbitrary point, and will continue to incre-
                        ment while the system is asleep.

The proper value to use should be

     CLOCK_UPTIME_RAW   clock that increments monotonically, in the same man-
                        ner as CLOCK_MONOTONIC_RAW, but that does not incre-
                        ment while the system is asleep.  The returned value
                        is identical to the result of mach_absolute_time()
                        after the appropriate mach_timebase conversion is
                        applied.

On Windows we have clock sources that vary during suspend, and some that don't.


v2:

  • added the same clarification for libvlc_clock()
  • rebased on master to get faster snap builds
Edited Aug 11, 2022 by Steve Lhomme
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: tick-now-suspend

VideoLAN code repository instance