X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.Runtime.CompilerServices%2FRuntimeHelpers.cs;h=0e182e3143c27066feadf8ce0e9434d71eabe8f8;hb=2e203a3f2e6c3022930c006b76c1423020a36378;hp=925de6dbfd42b65f0fd58f37e44525527de2f3c4;hpb=31ca4c480c7cf3f94029222335d84e4fde6dfbc5;p=mono.git diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs index 925de6dbfd4..0e182e3143c 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs @@ -28,6 +28,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // +using System.Runtime.Versioning; using System.Runtime.ConstrainedExecution; using System.Reflection; @@ -122,6 +123,16 @@ namespace System.Runtime.CompilerServices { } + // This method triggers a given delegate to be prepared. This involves preparing the + // delegate's Invoke method and preparing the target of that Invoke. In the case of + // a multi-cast delegate, we rely on the fact that each individual component was prepared + // prior to the Combine. In other words, this service does not navigate through the + // entire multicasting list. + // If our own reliable event sinks perform the Combine (for example AppDomain.DomainUnload), + // then the result is fully prepared. But if a client calls Combine himself and then + // then adds that combination to e.g. AppDomain.DomainUnload, then the client is responsible + // for his own preparation. + [System.Security.SecurityCritical] // auto-generated_required [MonoTODO("Currently a no-op")] public static void PrepareDelegate (Delegate d) { @@ -129,6 +140,25 @@ namespace System.Runtime.CompilerServices throw new ArgumentNullException ("d"); } + // extracted from ../../../../external/referencesource/mscorlib/system/runtime/compilerservices/runtimehelpers.cs + // + // See comment above for PrepareDelegate + // + // PrepareContractedDelegate weakens this a bit by only assuring that we prepare + // delegates which also have a ReliabilityContract. This is useful for services that + // want to provide opt-in reliability, generally some random event sink providing + // always reliable semantics to random event handlers that are likely to have not + // been written with relability in mind is a lost cause anyway. + // + // NOTE: that for the NGen case you can sidestep the required ReliabilityContract + // by using the [PrePrepareMethod] attribute. + [System.Security.SecurityCritical] // auto-generated_required + [ResourceExposure(ResourceScope.None)] + [MonoTODO("Currently a no-op")] + public static void PrepareContractedDelegate(Delegate d) + { + } + [MonoTODO("Currently a no-op")] public static void PrepareMethod (RuntimeMethodHandle method) {