dotnet / dotnet/dotnet-api-docs
Documentation "remarks" section is inconsistent with actual implementation
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
The **Remarks** section of the [Interlocked.MemoryBarrier](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked.memorybarrier) method document is inconsistent with the actual implementation.
to quote:
> This method was added to the [Interlocked](https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked?view=net-6.0) class in the .NET Framework 4.5 as a convenience;
> _it's a wrapper for the [Thread.MemoryBarrier](https://docs.microsoft.com/en-us/dotnet/api/system.threading.thread.memorybarrier?view=net-6.0) method._
This statement is correct for .NET Framework 4.x version. see [Source Code](https://referencesource.microsoft.com/#mscorlib/system/threading/interlocked.cs,251) in [Microsoft Reference Code](https://referencesource.microsoft.com/).
But when it comes to .NET [Core] the implementation is reversed. see [Source Code](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs#L549) in GitHub.
This might lead to some misunderstandings when reading the docs.
Contributor guide
Assessment
This issue has not been assessed yet.