On Wed, Oct 5, 2022, 12:38 AM Zebediah Figura <zfigura@codeweavers.com> wrote:
On 10/4/22 10:36, Jin-oh Kang wrote:
>>
>> Why does this need release semantics,
>
>
> This function can be inlined, and the write to `busy` can be reordered
> before any other operations.

Well, sure, but why is that a problem?

gdiplus uses image_lock() and image_unlock() to guard accesses to shared mutable state of GpImage. Not using mutual exclusion will result in a data race.


>
> and where is the corresponding
>> acquire?
>
>
> In image_lock's `InterlockedCompareExchange(&image->busy, ...)`
>

The point is that both of these questions should be clearly answered in
the patch itself :-)

Yes. I planned to address them in my reply to Esme's question, and the commit message as well. That would, however, need to be accompanied with a good explanation of memory models in general, so that I could convince anyone else reviewing them as well. I was just too busy to get back to it this week and finish up the reply. Sorry.