20 Oct
2025
20 Oct
'25
9:12 p.m.
On Mon Oct 20 21:11:35 2025 +0000, Rémi Bernon wrote:
Hmm... If the cache update is outside of the lock, more than one thread might have retrieved the sync and try to update the cache concurrently. I think in the current state this will break as multiple thread may pass the `if (InterlockedCompareExchange( &cache->refcount, 0, 0 ))` check successfully. With a separate lock, we still have to only allow one of the thread to cache its sync, and let the others on the stack.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9234#note_119102