17 Oct
2025
17 Oct
'25
12:04 p.m.
Thanks a lot! Out of curiosity, maybe this could be a `ReadPointerNoFence`? There are three cases: 1. `STATUS_INVALID_PARAMETER` is returned: this is a programmer error, and no pointer is returned. 2. `InterlockedCompareExchangePointer` is called, which inserts a full memory fence. 3. `STATUS_UNSUCCESSFUL` is returned: the caller should retrieve the value that "won" by calling `RtlRunOnceBeginInitialize` with `RTL_RUN_ONCE_CHECK_ONLY`, which uses acquire semantics. That said, it's _safer_ to ensure acquire semantics in a central place and not in each code branch. So probably this is best for long-term code maintenance? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9194#note_118883