Improve nullable annotation on Volatile.Read (#44410)
authorStephen Toub <stoub@microsoft.com>
Tue, 10 Nov 2020 00:17:12 +0000 (19:17 -0500)
committerGitHub <noreply@github.com>
Tue, 10 Nov 2020 00:17:12 +0000 (19:17 -0500)
commitfd3ae616fdf46a333902979b8679e5131106cc4c
tree337019594643a0c35422fa11cbca546a685e5673
parent24cc3d69af5acfc60e0f08003b71e7033e4b87a5
Improve nullable annotation on Volatile.Read (#44410)

Make it clear to the compiler that Volatile.Read doesn't write to the ref argument, such that if the input was non-null before the call, it'll still be non-null after the call.
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
src/libraries/System.Private.CoreLib/src/System/Threading/Volatile.cs
src/libraries/System.Threading.Thread/ref/System.Threading.Thread.cs
src/libraries/System.Threading/ref/System.Threading.cs