From: Koundinya Veluri Date: Wed, 16 Nov 2016 20:55:53 +0000 (-0800) Subject: Expose a member of StrongNameKeyPair, fix bug in SynchronizationContext (#8142) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3baf3a71dfa8a1504efd54973fe7ae5aedef0e13;p=platform%2Fupstream%2Fcoreclr.git Expose a member of StrongNameKeyPair, fix bug in SynchronizationContext (#8142) Related to dotnet/corefx#11636 Related to dotnet/corefx#11808 --- diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml index c47940e1f7..0ca6412461 100644 --- a/src/mscorlib/model.xml +++ b/src/mscorlib/model.xml @@ -10088,7 +10088,7 @@ - + diff --git a/src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs b/src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs index f9fbb631e1..1a38fafe8c 100644 --- a/src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs +++ b/src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs @@ -39,7 +39,6 @@ namespace System.Reflection private String _keyPairContainer; private byte[] _publicKey; -#if !FEATURE_CORECLR // Build key pair from file. [System.Security.SecuritySafeCritical] // auto-generated #pragma warning disable 618 @@ -57,7 +56,6 @@ namespace System.Reflection _keyPairExported = true; } -#endif// FEATURE_CORECLR // Build key pair from byte array in memory. [System.Security.SecuritySafeCritical] // auto-generated diff --git a/src/mscorlib/src/System/Threading/SynchronizationContext.cs b/src/mscorlib/src/System/Threading/SynchronizationContext.cs index 2f2dc36087..a9422c15a9 100644 --- a/src/mscorlib/src/System/Threading/SynchronizationContext.cs +++ b/src/mscorlib/src/System/Threading/SynchronizationContext.cs @@ -143,28 +143,39 @@ namespace System.Threading } #if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT - // Method called when the CLR does a wait operation + // Method called when the CLR does a wait operation [System.Security.SecurityCritical] // auto-generated_required [CLSCompliant(false)] [PrePrepareMethod] public virtual int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) + { + return WaitHelper(waitHandles, waitAll, millisecondsTimeout); + } + + // Method that can be called by Wait overrides + [System.Security.SecurityCritical] // auto-generated_required + [CLSCompliant(false)] + [PrePrepareMethod] + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] + protected static int WaitHelper(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) { if (waitHandles == null) { throw new ArgumentNullException(nameof(waitHandles)); } Contract.EndContractBlock(); - return WaitHelper(waitHandles, waitAll, millisecondsTimeout); + + return WaitHelperNative(waitHandles, waitAll, millisecondsTimeout); } - - // Static helper to which the above method can delegate to in order to get the default + + // Static helper to which the above method can delegate to in order to get the default // COM behavior. [System.Security.SecurityCritical] // auto-generated_required [CLSCompliant(false)] [PrePrepareMethod] - [MethodImplAttribute(MethodImplOptions.InternalCall)] + [MethodImplAttribute(MethodImplOptions.InternalCall)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected static extern int WaitHelper(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout); + private static extern int WaitHelperNative(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout); #endif #if FEATURE_CORECLR diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index 331bfe66cc..d5063c45f9 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -1860,7 +1860,7 @@ FCFuncEnd() FCFuncStart(gContextSynchronizationFuncs) #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT - FCFuncElement("WaitHelper", SynchronizationContextNative::WaitHelper) + FCFuncElement("WaitHelperNative", SynchronizationContextNative::WaitHelper) #endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT #ifdef FEATURE_APPX QCFuncElement("GetWinRTDispatcherForCurrentThread", SynchronizationContextNative::GetWinRTDispatcherForCurrentThread)