Fix FileStream.FlushAsync() to behave like Flush() (dotnet/coreclr#24902)
Flush() behaves like Flush(false) and writes out any buffered data but doesn't P/Invoke to FlushFileBuffers/FSync to flush the OS buffers. But whereas FlushAsync() is supposed to just be an async equivalent of Flush(), it's actually behaving like Flush(true). This makes FlushAsync() inconsistent and much more expensive. (This is separate from FlushAsync not actually being async, which is an impactful problem to be solved separately.) This changes FlushAsync to behave like Flush()/Flush(false) rather than Flush(true). If someone wants the FlushFileBuffers/FSync behavior, they can call Flush(true). Commit migrated from https://github.com/dotnet/coreclr/commit/436debb93c390e144f9c25b5d1922ac7780745f4
Showing
想要评论请 注册 或 登录