What is the correct usage of InterlockedCompareExchange for optimistic synchronization to avoid the new C28112 warning in MSVC?
I’ve written optimistic thread-synchronization routines lots of times before, but today, the pattern that I’ve used for years now generates a warning in recent versions of VC++ (using VS 2022, v17.9.5):