[vlc-devel] CLOCK_MONOTONIC
Rafaël Carré
funman at videolan.org
Sun Sep 16 14:47:43 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Rémi Denis-Courmont a écrit :
> The value cannot be the Epoch. CLOCK_REALTIME is the Epoch. CLOCK_REALTIME can
> go backward (through settimeofday/clock_settime), and CLOCK_MONOTONIC cannot,
> by definition. As such, CLOCK_MONOTONIC cannot be the Epoch (it could have
> the same value at any given time, by pure accident only).
>
> In practice CLOCK_MONOTONIC is the system uptime, much like GetTickCount() On
> Win32, or times() on old Unices. Depending on OSes and versions, it does or
> does not include suspend time.
>
>> 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.
>
> I don't get your problem. mdate() uses CLOCK_MONOTONIC (if available), and so
> do vlc_cond_*(). This is required, otherwise vlc_cond_timedwait() could not
> be made to work at all.
>
French man page for pthread_cond_timedwait didn't precise the clock used
could be changed.
Should be fixed in [22066]
- --
Rafaël Carré
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG7SXvYWCeGMCv8Q8RAhh8AJ9CJqS4dIRSoXAX2Y57pWD9z+pw8wCfdU5+
wMlEsUN9jSY+SzdMZExcnPc=
=M9X8
-----END PGP SIGNATURE-----
More information about the vlc-devel
mailing list