[vlc-devel] [PATCH 2/2] thread: remove redundant darwin thread code

Marvin Scholz epirat07 at gmail.com
Sat Feb 22 13:41:05 CET 2020


On 22 Feb 2020, at 12:39, Rémi Denis-Courmont wrote:

> Le lauantaina 22. helmikuuta 2020, 13.12.40 EET Marvin Scholz a écrit :
>> A bit cleaner approach could be to split the clock/tick related stuff in
>> thead.c into a different file so that no ifdef’ery would be needed, just
>> a conditional source.
>
> Yes but first you should rather try to eliminate the MacOS tick stuff.

I don’t think thats possible, else I would have done that (see below).

> If wait.c works, then I don't see why the mach clock is still necessary.
>

The issue is that clock_gettime is not available on the lowest macOS
version we target (10.11), it only was introduced in macOS 10.12.

I just noticed vlc_atomic_timedwait uses it unconditionally, which I’ll
have to change for macOS. (Looks like we do not set -Wunguarded-availability
so I completely missed that earlier…)

For the usage in wait.c it seems that timespec_get could be used instead?
At least from reading the compat code it seems equivalent.

Even if we could use clock_gettime, the posix thread code additionally
uses clock_nanosleep which is not available at all on macOS.

> -- 
> 雷米‧德尼-库尔蒙
> http://www.remlab.net/
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list