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

Giovanni Mascellani gmascellani at codeweavers.com
Fri Jul 2 09:59:00 CDT 2021


Hi,

Il 02/07/21 00:35, Zebediah Figura ha scritto:
>   static BOOL wined3d_cs_queue_is_empty(const struct wined3d_cs *cs, const struct wined3d_cs_queue *queue)
>   {
> -    wined3d_from_cs(cs);
> +    wined3d_from_cs(cs->c.device);
>       return *(volatile LONG *)&queue->head == queue->tail;
>   }

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.



More information about the wine-devel mailing list