// // // // // $Revision: 2185 $ // using System; using System.Collections.Generic; using Debugger.Wrappers.CorDebug; namespace Debugger { public partial class Process { List activeEvals = new List(); Queue pendingEvalsCollection = new Queue(); public bool Evaluating { get { return activeEvals.Count > 0; } } internal Eval GetEval(ICorDebugEval corEval) { return activeEvals.Find(delegate (Eval eval) {return eval.IsCorEval(corEval);}); } /// /// Adds eval to a list of pending evals. /// internal void ScheduleEval(Eval eval) { pendingEvalsCollection.Enqueue(eval); } public void StartEvaluation() { if (this.IsPaused) { if (this.SetupNextEvaluation()) { this.Continue(); } } } internal void NotifyEvaluationComplete(Eval eval) { activeEvals.Remove(eval); } // return true if there was eval to setup and it was setup internal bool SetupNextEvaluation() { this.AssertPaused(); while (pendingEvalsCollection.Count > 0) { Eval nextEval = pendingEvalsCollection.Dequeue(); if (nextEval.SetupEvaluation(this.SelectedThread)) { activeEvals.Add(nextEval); return true; } } return false; } } }