[PATCH 2/2] wined3d: Pass a wined3d_device pointer to wined3d_from_cs().

Jan Sikorski jsikorski at codeweavers.com
Fri Jul 2 10:09:50 CDT 2021

> That's not related to this patch, but it caught my attention: why are we using "volatile" here?
> My understanding is that "volatile" should only be used to deal with special memory (like MMIO), but I don't think this it is the case here. (or is it?)
> Here it seems that "volatile" is using to do inter-thread communication, but that's in general wrong: it doesn't protect from data races and it doesn't ensure atomicity.
> What am I missing?
> Giovanni.

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

More information about the wine-devel mailing list