[vlc-devel] [PATCH 2/2] thread: remove redundant darwin thread code
Rémi Denis-Courmont
remi at remlab.net
Sat Feb 22 14:20:23 CET 2020
Le lauantaina 22. helmikuuta 2020, 14.41.05 EET Marvin Scholz a écrit :
> 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?
I doubt that that'll work when I finish fixing the remaining TODO in that file.
And that's the whole point of keeping the MacOS code separate.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list