On Wed Oct 26 15:50:34 2022 +0000, Jinoh Kang wrote:
Quoting my previous reply:
The idea was that `server_select` should act as a strong memory barrier itself, so that the thread calling `FlushProcessWriteBuffers` did not need to call `MemoryBarrier()` explicitly. ~~That said, I think it makes sense to just put `MemoryBarrier()` in `NtFlushProcessWriteBuffers`.~~ **EDIT**: See next comment I noticed the following comment in the latest revision:
``` /* Ensure writes so far are visible to other threads, so that we can avoid sending a memory barrier APC * from NtFlushProcessWriteBuffers to this thread while it is sleeping. */ MemoryBarrier(); ``` So I'd say this is paired with future `FlushProcessWriteBuffers` requests from other threads while the current thread is sleeping. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/741#note_12243