The Labs \ Source Viewer \ SSCLI \ System.Runtime.ConstrainedExecution \ CriticalFinalizerObject

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*============================================================
  16. **
  17. ** Class:  CriticalFinalizerObject
  18. **
  19. **
  20. ** Deriving from this class will cause any finalizer you define to be critical
  21. ** (i.e. the finalizer is guaranteed to run, won't be aborted by the host and is
  22. ** run after the finalizers of other objects collected at the same time).
  23. **
  24. ** You must possess UnmanagedCode permission in order to derive from this class.
  25. **
  26. **
  27. ===========================================================*/
  28. using System;
  29. using System.Security.Permissions;
  30. using System.Runtime.InteropServices;
  31. namespace System.Runtime.ConstrainedExecution
  32. {
  33.    
  34.     [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)]
  35.     [System.Runtime.InteropServices.ComVisible(true)]
  36.     public abstract class CriticalFinalizerObject
  37.     {
  38.         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
  39.         protected CriticalFinalizerObject()
  40.         {
  41.         }
  42.        
  43.         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
  44.         ~CriticalFinalizerObject()
  45.         {
  46.         }
  47.     }
  48. }

Developer Fusion