[PATCH 2/2] wined3d: Pass a wined3d_device pointer to wined3d_from_cs().
gmascellani at codeweavers.com
Sun Jul 4 09:48:32 CDT 2021
Il 03/07/21 17:42, Stefan Dösinger ha scritto:
> Am Freitag, 2. Juli 2021, 17:09:50 CEST schrieb Jan Sikorski:
>> I guess it’s to force a memory load on each call, which could be omitted if
>> the function is inlined. X86 loads are atomic IIRC. - Jan
> It was necessary to make ARM CPUs re-load the data from memory. gcc inlines
> the function and would put both head and tail in a register and loop forever.
My understanding is that this solution is not correct. As far is I
understand, the "volatile" qualifier doesn't force the generation of
appropriate fencing and doesn't protect you from data races: if a thread
writes the value at the same time another is reading or writing it, you
are hitting undefined behavior.
I think that atomic values should be used here, and if there is no
atomic support in the C version we are using, then we should manually
use Interlocked* functions.
More information about the wine-devel