internal SuspendToken(SuspendableObject parent) { var suspendLevel = System.Threading.Interlocked.Increment(ref parent._suspendLevel); _parent = parent; if (1 == suspendLevel) { try { _parent.OnSuspended(); } catch (Exception) { System.Threading.Interlocked.Decrement(ref parent._suspendLevel); _parent = null; throw; } } }
internal TemporaryResumeToken(SuspendableObject parent) { _parent = parent; }
internal TemporaryResumeToken(SuspendableObject parent) { _parent = parent; }
internal SuspendToken(SuspendableObject parent) { var suspendLevel = System.Threading.Interlocked.Increment(ref parent._suspendLevel); _parent = parent; if (1 == suspendLevel) { try { _parent.OnSuspended(); } catch (Exception) { System.Threading.Interlocked.Decrement(ref parent._suspendLevel); _parent = null; throw; } } }