Description
"In managed threading, Thread.GetHashCode is the stable managed thread identification. For the lifetime of your thread, it will not collide with the value from any other thread, regardless of the application domain from which you obtain this value."
But from here (Thread.GetHashCode Method): https://docs.microsoft.com/en-us/dotnet/api/system.threading.thread.gethashcode?view=netframework-4.8
"The hash code is not guaranteed to be unique. Use the ManagedThreadId property if you need a unique identifier for a managed thread."
Apparently, the latter statement is incorrect as GetHashCode and ManagedThreadId both return the same value and seem to be the same because GetHashCode actually returns m_ManagedThreadId (although it's unclear how it is initialized).
Since there's no feedback capability in the GetHashCode article, I post here.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 2e267fd4-6615-49ca-c77f-c97ecdbacb9b
- Version Independent ID: 95febe7e-6407-4be4-484d-1621db41c5e7
- Content: Managed and Unmanaged Threading in Windows
- Content Source: docs/standard/threading/managed-and-unmanaged-threading-in-windows.md
- Product: dotnet
- Technology: dotnet-standard
- GitHub Login: @rpetrusha
- Microsoft Alias: ronpet