I looked for the implementation of this function in MSVC STL source on github, but found no code other than setting the synchronization flag.
Next, I wrote a simple program with a call to this function, and ran it under a debugger, hoping to find a reading of the address of this flag. But during the operation of the program, nothing reads this flag, except for the function itself.
Why didn't Microsoft implement this feature?
After that, I went to cppreference and was surprised by the detailed description of the function. Where does this information come from? It turns out that GCC is used in the cppreference examples, I went to look at libstdc++ source, where I found that this function is fully implemented.
Why did Microsoft decide to do this? Maybe their goal is to ensure the security and full synchronization of I/O streams?