Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseTimeout settings routed to ObjectValueAdaptor #96

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public class AsyncEvaluationTracker: RemoteFrameObject, IObjectValueUpdater, IDi
int asyncCounter = 0;
int cancelTimestamp = 0;
TimedEvaluator runner = new TimedEvaluator ();


public bool UseTimeout {
get { return runner.UseTimeout; }
set { runner.UseTimeout = value; }
}

public int WaitTime {
get { return runner.RunTimeout; }
set { runner.RunTimeout = value; }
Expand Down
17 changes: 13 additions & 4 deletions Mono.Debugging/Mono.Debugging.Evaluation/ObjectValueAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,19 @@ public abstract class ObjectValueAdaptor: IDisposable
readonly Dictionary<string, TypeDisplayData> typeDisplayData = new Dictionary<string, TypeDisplayData> ();

// Time to wait while evaluating before switching to async mode
public int DefaultEvaluationWaitTime { get; set; }

public int DefaultEvaluationWaitTime {
get { return asyncEvaluationTracker.WaitTime; }
set { asyncEvaluationTracker.WaitTime = value; }
}

/// <summary>
/// Enables or disables async evaluation
/// </summary>
public bool UseTimeout {
get { return asyncEvaluationTracker.UseTimeout; }
set { asyncEvaluationTracker.UseTimeout = value; }
}

public event EventHandler<BusyStateEventArgs> BusyStateChanged;

static readonly Dictionary<string, string> CSharpTypeNames = new Dictionary<string, string> ();
Expand Down Expand Up @@ -74,9 +85,7 @@ static ObjectValueAdaptor ()
protected ObjectValueAdaptor ()
{
DefaultEvaluationWaitTime = 100;

asyncOperationManager.BusyStateChanged += (sender, e) => OnBusyStateChanged (e);
asyncEvaluationTracker.WaitTime = DefaultEvaluationWaitTime;
}

public void Dispose ()
Expand Down
6 changes: 3 additions & 3 deletions Mono.Debugging/Mono.Debugging.Evaluation/TimedEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class TimedEvaluator
List<Task> executingTasks = new List<Task> ();
int runningThreads;
int busyThreads;
bool useTimeout;
internal bool UseTimeout { get; set; }
bool disposed;
static int threadNameId;

Expand All @@ -54,7 +54,7 @@ public TimedEvaluator () : this (true)
public TimedEvaluator (bool useTimeout)
{
RunTimeout = 1000;
this.useTimeout = useTimeout;
UseTimeout = useTimeout;
}

public int RunTimeout { get; set; }
Expand All @@ -76,7 +76,7 @@ public bool IsEvaluating {
/// </summary>
public bool Run (EvaluatorDelegate evaluator, EvaluatorDelegate delayedDoneCallback)
{
if (!useTimeout) {
if (!UseTimeout) {
SafeRun (evaluator);
return true;
}
Expand Down