Fix based on feedback
authorMichelle McDaniel <adiaaida@gmail.com>
Wed, 4 Oct 2017 17:09:29 +0000 (10:09 -0700)
committerMichelle McDaniel <adiaaida@gmail.com>
Mon, 9 Oct 2017 16:08:24 +0000 (09:08 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/7cd72c28288c22b9595fad850291d89834aa99e1

src/libraries/Common/src/Interop/Windows/kernel32/Interop.WaitForSingleObject.cs
src/libraries/Common/src/Interop/Windows/kernel32/Interop.WaitForSingleObjectDontcallThis.cs [deleted file]
src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedUtils.cs

index 3efbe5e..41a40e5 100644 (file)
@@ -6,11 +6,11 @@ using System;
 using System.Runtime.InteropServices;
 using Microsoft.Win32.SafeHandles;
 
-internal static partial class Interop
+internal partial class Interop
 {
-    internal static partial class Kernel32
+    internal partial class Kernel32
     {
-        [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, SetLastError = true, EntryPoint = "WaitForSingleObject")]
-        public static extern int WaitForSingleObject(SafeWaitHandle handle, int timeout);
+        [DllImport(Libraries.Kernel32, ExactSpelling=true, SetLastError=true, EntryPoint="WaitForSingleObject")]
+        internal static extern int WaitForSingleObject(SafeWaitHandle handle, int timeout);
     }
 }
diff --git a/src/libraries/Common/src/Interop/Windows/kernel32/Interop.WaitForSingleObjectDontcallThis.cs b/src/libraries/Common/src/Interop/Windows/kernel32/Interop.WaitForSingleObjectDontcallThis.cs
deleted file mode 100644 (file)
index 9a8bd19..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System;
-using System.Runtime.InteropServices;
-using Microsoft.Win32.SafeHandles;
-
-internal partial class Interop
-{
-    internal partial class Kernel32
-    {
-        [DllImport(Libraries.Kernel32, ExactSpelling=true, SetLastError=true, EntryPoint="WaitForSingleObject")]
-        internal static extern int WaitForSingleObjectDontCallThis(SafeWaitHandle handle, int timeout);
-    }
-}
index c64d44d..deb9529 100644 (file)
@@ -169,7 +169,7 @@ namespace System.Diagnostics
                 // Holding a mutex requires us to keep thread affinity and announce ourselves as a critical region.
                 Thread.BeginCriticalRegion();
                 Thread.BeginThreadAffinity();
-                int result = Interop.Kernel32.WaitForSingleObjectDontCallThis(mutexIn.SafeWaitHandle, 500);
+                int result = Interop.Kernel32.WaitForSingleObject(mutexIn.SafeWaitHandle, 500);
                 switch (result)
                 {