Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-06-22 15:18:41 +0000
committerDarin Wright2009-06-22 15:18:41 +0000
commit7fc31ba9e7f350fb3885984b507f92054714ed96 (patch)
tree71855450243c6b99cec66ec2e0ea6f63f31dc219 /org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
parentd586b842fb392efc56d58debf79d927bf3a9f56d (diff)
downloadeclipse.platform.debug-7fc31ba9e7f350fb3885984b507f92054714ed96.tar.gz
eclipse.platform.debug-7fc31ba9e7f350fb3885984b507f92054714ed96.tar.xz
eclipse.platform.debug-7fc31ba9e7f350fb3885984b507f92054714ed96.zip
Bug 246148 - Debugger race condition: an expression is marked as "not pending" before its result has been set
Diffstat (limited to 'org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
index 22cd0e14b..ed51fc9e6 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
@@ -72,7 +72,6 @@ public class WatchExpression implements IWatchExpression {
* @see org.eclipse.debug.core.model.IWatchExpressionListener#watchEvaluationFinished(org.eclipse.debug.core.model.IWatchExpressionResult)
*/
public void watchEvaluationFinished(IWatchExpressionResult result) {
- setPending(false);
setResult(result);
}
};
@@ -129,8 +128,10 @@ public class WatchExpression implements IWatchExpression {
public void setResult(IWatchExpressionResult result) {
synchronized (this) {
fResult= result;
+ fPending = false;
}
- fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT));
+ fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.STATE)); // pending state
+ fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT)); // value change
}
/**
@@ -257,7 +258,7 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IWatchExpression#isPending()
*/
- public boolean isPending() {
+ public synchronized boolean isPending() {
return fPending;
}
@@ -268,7 +269,9 @@ public class WatchExpression implements IWatchExpression {
* flagged as pending
*/
protected void setPending(boolean pending) {
- fPending= pending;
+ synchronized (this) {
+ fPending= pending;
+ }
fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.STATE));
}

Back to the top