Add NotNullIfNotNull attribute to Interlocked.CompareExchange (dotnet/coreclr#26135)
authorStephen Toub <stoub@microsoft.com>
Mon, 12 Aug 2019 20:48:18 +0000 (16:48 -0400)
committerGitHub <noreply@github.com>
Mon, 12 Aug 2019 20:48:18 +0000 (16:48 -0400)
commit400f21e68a9c9279ac76533e6eb37f435f6b75a7
treebe563e6310de87a6ccfb61b08d09bf2178414361
parent5c0459c94a530ee4bee5dfc38fa8a29a32759a4b
Add NotNullIfNotNull attribute to Interlocked.CompareExchange (dotnet/coreclr#26135)

To handle its return value, which (ignoring race conditions, as wel do for nullability analysis in general) is the input value of `location1`.  The output value of `location1` is handled as a special-case by the compiler.

Commit migrated from https://github.com/dotnet/coreclr/commit/6a5062bd6c870fd4d378996b50ce32d610d04cae
src/coreclr/src/System.Private.CoreLib/src/System/Threading/Interlocked.cs