[vlc-devel] [PATCH] src: darwin/thread: reimplement monotonic clock for darwin

David Fuhrmann david.fuhrmann at gmail.com
Mon Jan 6 21:20:18 CET 2014


Hello,

Am 06.01.2014 um 20:10 schrieb Rémi Denis-Courmont <remi at remlab.net>:

> Le lundi 6 janvier 2014, 15:16:12 David Fuhrmann a écrit :
>> I asked on the Apple dev forums about this topic, and an Apple developer
>> confirmed that both pthread_cond_timedwait and
>> pthread_cond_timedwait_relative_np always make use of the monotonic clock
>> (mach absolute time).
> 
> I digress but...
> 
> As far as absolute deadlines are concerned, that statement does not make much 
> sense. pthread_cond_timedwait() has to follow the real-time clock (unless 
> clock selection is supported and another clock has been selected explicitly).

Then you need to complain to Apple. As it looks like, you just cannot assume the real time clock
is used by default here, on Darwin.

> Anyway, to the point:
> 
>> So, this patch seems right and makes the clock usage consistent.
>> 
>> I still need to fix cond_init_daytime, through.
> 
> That is a convoluted way of expressing that the patch is wrong, as I said.

This patch (after modifying it so that the normal timedwait() is called in case of cond_init_daytime) does not make the situation any worse as it already is.
Still, the same cond_timedwait function is called.

With best regards,
David


More information about the vlc-devel mailing list