public DbgEvaluationContextImpl(DbgLanguage language, DbgRuntime runtime, TimeSpan funcEvalTimeout, DbgEvaluationContextOptions options) { lockObj = new object(); Language = language ?? throw new ArgumentNullException(nameof(language)); Runtime = runtime ?? throw new ArgumentNullException(nameof(runtime)); FuncEvalTimeout = funcEvalTimeout; Options = options; continueContext = new DbgContinueContext(); continueContext.Closed += DbgContinueContext_Closed; runtime.CloseOnContinue(continueContext); }
void DbgContinueContext_Closed(object sender, EventArgs e) { continueContext.Closed -= DbgContinueContext_Closed; if (!IsClosed && !Runtime.IsClosed) { lock (lockObj) { continueContext = new DbgContinueContext(); continueContext.Closed += DbgContinueContext_Closed; Runtime.CloseOnContinue(continueContext); } } }
public override void CloseOnContinue(DbgObject obj) { if (obj is null) { throw new ArgumentNullException(nameof(obj)); } lock (lockObj) { if (IsClosed) { Process.DbgManager.Close(obj); } else { closeOnContinueList.Add(obj); } } }