[vlc-devel] [PATCH 1/6] os2: implement vlc_once()

Romain Vimont rom at rom1v.com
Thu Apr 5 22:14:06 CEST 2018


On Thu, Apr 05, 2018 at 08:40:57PM +0900, KO Myung-Hun wrote:
> And if it is 1, it's guaranteed that cb() has been completed. Because
> function call acts as memory barrier and it will not be reordered

At least in theory, I think that a function call does not act as a
memory barrier.

And even if it did, so that cb() is guaranteed to be completed in the
first thread, the changes applied by cb() are not guaranteed to be
visible from the second thread (cache coherence).

<https://stackoverflow.com/questions/10698253/is-function-call-an-effective-memory-barrier-for-modern-platforms>


More information about the vlc-devel mailing list