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

Marvin Scholz epirat07 at gmail.com
Sat Feb 22 12:12:40 CET 2020


On 22 Feb 2020, at 8:15, Rémi Denis-Courmont wrote:

> Le lauantaina 22. helmikuuta 2020, 4.23.39 EET Marvin Scholz a écrit :
>> A lot of the code for darwin threading was exactly the same as the
>> posix one, so instead of having a copy of the code that needs to be
>> maintained, use the posix thread code
> It used to be that way, and it degenerated into an ugly pile of ifdef's
> because of MacOS bugs and proprietary interfaces.

Thats a valid point, although with your recent changes all of the stuff
that was different due to bugs is gone now and nearly everything except
the clock related stuff was just exactly the same.

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.

If we ever get to the point where for some reason due to bugs in macOS
pthread or so we need to do stuff different from posix again, we could
revert this change and again have a copy of the code but currently it just
seems to complicate maintenance of the code as the macOS code would not
benefit from improvements of the posix code without someone manually
copying it over.

> Plus it makes it impossible
> for people with Mac's to test/change the POSIX code.

Can you clarify on that? I don’t fully understand, how would you even do
that before my changes?

> Not sure we want to get back there.

I have no strong opinions on this, it just seemed nice to get rid of all
the duplicated code that did exactly the same.

> -- 
> Rémi Denis-Courmont
> 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