[netcore] Update System.Private.CoreLib public APIs
authorMarek Safar <marek.safar@gmail.com>
Tue, 10 Sep 2019 09:08:00 +0000 (11:08 +0200)
committerMarek Safar <marek.safar@gmail.com>
Tue, 10 Sep 2019 10:11:31 +0000 (12:11 +0200)
Commit migrated from https://github.com/mono/mono/commit/96b7fead3377a0944bbb16dea309749bc995226e

src/mono/netcore/System.Private.CoreLib/src/System.Runtime.Loader/AssemblyLoadContext.cs
src/mono/netcore/System.Private.CoreLib/src/System.Threading/Interlocked.cs

index 0ac47c9..98e4f2c 100644 (file)
@@ -52,7 +52,7 @@ namespace System.Runtime.Loader
                        }
                }
 
-               public static Assembly[] GetLoadedAssemblies ()
+               internal static Assembly[] GetLoadedAssemblies ()
                {
                        return InternalGetLoadedAssemblies ();
                }
index e19833b..fc0b8d4 100644 (file)
@@ -3,6 +3,7 @@
 // See the LICENSE file in the project root for more information.
 
 using System.Runtime.CompilerServices;
+using System.Diagnostics.CodeAnalysis;
 
 namespace System.Threading
 {
@@ -48,7 +49,8 @@ namespace System.Threading
                public extern static double CompareExchange (ref double location1, double value, double comparand);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public extern static T CompareExchange<T> (ref T location1, T value, T comparand) where T : class;
+               [return: NotNullIfNotNull("location1")]
+               public extern static T CompareExchange<T> (ref T location1, T value, T comparand) where T : class?;
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static long Exchange (ref long location1, long value);
@@ -60,7 +62,8 @@ namespace System.Threading
                public extern static double Exchange (ref double location1, double value);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
-               public extern static T Exchange<T> (ref T location1, T value) where T : class;
+               [return: NotNullIfNotNull("location1")]
+               public extern static T Exchange<T> (ref T location1, T value) where T : class?;
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static long Read (ref long location);