[vlc-devel] CLOCK_MONOTONIC

Rafaël Carré funman at videolan.org
Sun Sep 16 01:29:10 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've doubts on the use of CLOCK_MONOTONIC in src/misc/mtime.c

clock_gettime(CLOCK_MONOTONIC, &x) returns 4 different values on 4
different machines i tested.

http://www.opengroup.org/onlinepubs/000095399/functions/clock_getres.html
says:

For this clock, the value returned by clock_gettime() represents the
amount of time (in seconds and nanoseconds) since an unspecified point
in the past (for example, system start-up time, or the Epoch). This
point does not change after system start-up time. The value of the
CLOCK_MONOTONIC clock cannot be set via clock_settime(). This function
shall fail if it is invoked with a clock_id argument of CLOCK_MONOTONIC.
[Option End]

So the starting value may, or may not be the Epoch.

this causes __vlc_cond_wait() to immediately timeout instead of after 1
second, because the time elapsed since epoch is always more than the
time elapsed since my machine booted up, or since chicken have teeth.

- --
Rafaël Carré
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG7GrGYWCeGMCv8Q8RAhWdAKC6JyrasggasT2viRmUD+/WX8bangCgqKx6
brkyWzM1bMTR+l+66t1HJb4=
=HUNb
-----END PGP SIGNATURE-----



More information about the vlc-devel mailing list