Skip to content

Commit e3e6655

Browse files
caching thread state
1 parent 1c767a2 commit e3e6655

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class ThreadMirror : ObjectMirror
1313
ManualResetEvent fetchingEvent = new ManualResetEvent (false);
1414
ThreadInfo info;
1515
StackFrame[] frames;
16+
bool threadStateInvalid = true;
17+
ThreadState threadState;
1618

1719
internal ThreadMirror (VirtualMachine vm, long id) : base (vm, id) {
1820
}
@@ -30,6 +32,7 @@ public StackFrame[] GetFrames () {
3032

3133
internal void InvalidateFrames () {
3234
cacheInvalid = true;
35+
threadStateInvalid = true;
3336
}
3437

3538
internal void FetchFrames (bool mustFetch = false) {
@@ -91,7 +94,11 @@ public string Name {
9194

9295
public ThreadState ThreadState {
9396
get {
94-
return (ThreadState)vm.conn.Thread_GetState (id);
97+
if (threadStateInvalid) {
98+
threadState = (ThreadState) vm.conn.Thread_GetState (id);
99+
threadStateInvalid = false;
100+
}
101+
return threadState;
95102
}
96103
}
97104

0 commit comments

Comments
 (0)