internal CompressedStackRunData(CompressedStack cs, ContextCallback cb, Object state)
 {
     this.cs       = cs;
     this.callBack = cb;
     this.state    = state;
     this.cssw     = new CompressedStackSwitcher();
 }
        [HandleProcessCorruptedStateExceptions] //
#endif // FEATURE_CORRUPTING_EXCEPTIONS
        internal static CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
        {
            CompressedStackSwitcher cssw = new CompressedStackSwitcher();

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                // Order is important in this block.
                // Also, we dont want any THreadAborts happening when we try to set it
                RuntimeHelpers.PrepareConstrainedRegions();
                try
                {
                    // Empty try block to ensure no ThreadAborts in the finally block
                }
                finally
                {
                    // SetCompressedStackThread can throw - only if it suceeds we shd update the switcher and overrides
                    SetCompressedStackThread(cs);
                    cssw.prev_CS      = prevCS;
                    cssw.curr_CS      = cs;
                    cssw.prev_ADStack = SetAppDomainStack(cs);
                }
            }
            catch
            {
                cssw.UndoNoThrow();
                throw; // throw the original exception
            }
            return(cssw);
        }
示例#3
0
        internal static CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
        {
            CompressedStackSwitcher compressedStackSwitcher = new CompressedStackSwitcher();

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                RuntimeHelpers.PrepareConstrainedRegions();
                try
                {
                }
                finally
                {
                    CompressedStack.SetCompressedStackThread(cs);
                    compressedStackSwitcher.prev_CS      = prevCS;
                    compressedStackSwitcher.curr_CS      = cs;
                    compressedStackSwitcher.prev_ADStack = CompressedStack.SetAppDomainStack(cs);
                }
            }
            catch
            {
                compressedStackSwitcher.UndoNoThrow();
                throw;
            }
            return(compressedStackSwitcher);
        }
示例#4
0
        internal static CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
        {
            CompressedStackSwitcher result = default(CompressedStackSwitcher);

            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                RuntimeHelpers.PrepareConstrainedRegions();
                try
                {
                }
                finally
                {
                    CompressedStack.SetCompressedStackThread(cs);
                    result.prev_CS      = prevCS;
                    result.curr_CS      = cs;
                    result.prev_ADStack = CompressedStack.SetAppDomainStack(cs);
                }
            }
            catch
            {
                result.UndoNoThrow();
                throw;
            }
            return(result);
        }
        public override bool Equals(Object obj)
        {
            if (obj == null || !(obj is CompressedStackSwitcher))
            {
                return(false);
            }
            CompressedStackSwitcher sw = (CompressedStackSwitcher)obj;

            return(this.curr_CS == sw.curr_CS && this.prev_CS == sw.prev_CS && this.prev_ADStack == sw.prev_ADStack);
        }
        public override bool Equals(object obj)
        {
            if ((obj == null) || !(obj is CompressedStackSwitcher))
            {
                return(false);
            }
            CompressedStackSwitcher switcher = (CompressedStackSwitcher)obj;

            return(((this.curr_CS == switcher.curr_CS) && (this.prev_CS == switcher.prev_CS)) && (this.prev_ADStack == switcher.prev_ADStack));
        }
示例#7
0
		public static bool op_Equality (CompressedStackSwitcher c1, CompressedStackSwitcher c2)
		{
			if (c1._cs == null)
				return (c2._cs == null);
			if (c2._cs == null)
				return false;

			if (c1._t.ManagedThreadId != c2._t.ManagedThreadId)
				return false;
			return c1._cs.Equals (c2._cs);
		}
示例#8
0
        public override bool Equals(object obj)
        {
            if (obj == null || !(obj is CompressedStackSwitcher))
            {
                return(false);
            }
            CompressedStackSwitcher compressedStackSwitcher = (CompressedStackSwitcher)obj;

            if (this.curr_CS == compressedStackSwitcher.curr_CS && this.prev_CS == compressedStackSwitcher.prev_CS)
            {
                return(this.prev_ADStack == compressedStackSwitcher.prev_ADStack);
            }
            return(false);
        }
示例#9
0
        public static bool op_Equality(CompressedStackSwitcher c1, CompressedStackSwitcher c2)
        {
            if (c1._cs == null)
            {
                return(c2._cs == null);
            }
            if (c2._cs == null)
            {
                return(false);
            }

            if (c1._t.ManagedThreadId != c2._t.ManagedThreadId)
            {
                return(false);
            }
            return(c1._cs.Equals(c2._cs));
        }
示例#10
0
 public static bool op_Inequality(CompressedStackSwitcher c1, CompressedStackSwitcher c2)
 {
     return(!op_Equality(c1, c2));
 }
示例#11
0
        [HandleProcessCorruptedStateExceptions] // 
#endif // FEATURE_CORRUPTING_EXCEPTIONS
        internal static CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
        {
            CompressedStackSwitcher cssw = new CompressedStackSwitcher();
            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                // Order is important in this block.
                // Also, we dont want any THreadAborts happening when we try to set it
                RuntimeHelpers.PrepareConstrainedRegions();
                try
                {
                    // Empty try block to ensure no ThreadAborts in the finally block
                }
                finally
                {
                    // SetCompressedStackThread can throw - only if it suceeds we shd update the switcher and overrides
                    SetCompressedStackThread(cs);
                    cssw.prev_CS = prevCS;
                    cssw.curr_CS = cs;
                    cssw.prev_ADStack = SetAppDomainStack(cs);                
                }
            }
            catch
            {
                cssw.UndoNoThrow();
                throw; // throw the original exception
            }
            return cssw;
        }
示例#12
0
 internal CompressedStackRunData(CompressedStack cs, ContextCallback cb, Object state)
 {
     this.cs = cs;
     this.callBack = cb;
     this.state = state;
     this.cssw = new CompressedStackSwitcher();
 }
示例#13
0
 internal static CompressedStackSwitcher SetCompressedStack(CompressedStack cs, CompressedStack prevCS)
 {
     CompressedStackSwitcher switcher = new CompressedStackSwitcher();
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
         RuntimeHelpers.PrepareConstrainedRegions();
         try
         {
         }
         finally
         {
             SetCompressedStackThread(cs);
             switcher.prev_CS = prevCS;
             switcher.curr_CS = cs;
             switcher.prev_ADStack = SetAppDomainStack(cs);
         }
     }
     catch
     {
         switcher.UndoNoThrow();
         throw;
     }
     return switcher;
 }
示例#14
0
		public static bool op_Inequality (CompressedStackSwitcher c1, CompressedStackSwitcher c2)
		{
			return !op_Equality (c1, c2);
		}