mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15:39 +02:00
[275136] [view model] done() may be called twice on request monitor
This commit is contained in:
parent
1054b43f5b
commit
2964162173
2 changed files with 12 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2008 Wind River Systems and others.
|
* Copyright (c) 2007, 2009 Wind River Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -272,14 +272,11 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider
|
||||||
childNodes[i],
|
childNodes[i],
|
||||||
new VMChildrenCountUpdate(update, childrenCountMultiReqMon.add(new ViewerDataRequestMonitor<Integer>(
|
new VMChildrenCountUpdate(update, childrenCountMultiReqMon.add(new ViewerDataRequestMonitor<Integer>(
|
||||||
getVMProvider().getExecutor(), update) {
|
getVMProvider().getExecutor(), update) {
|
||||||
@Override
|
|
||||||
protected void handleSuccess() {
|
|
||||||
counts[nodeIndex] = getData();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleCompleted() {
|
protected void handleCompleted() {
|
||||||
super.handleCompleted();
|
if (isSuccess()) {
|
||||||
|
counts[nodeIndex] = getData();
|
||||||
|
}
|
||||||
childrenCountMultiReqMon.requestMonitorDone(this);
|
childrenCountMultiReqMon.requestMonitorDone(this);
|
||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -123,6 +123,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
private int fLowIndex = 0;
|
private int fLowIndex = 0;
|
||||||
private int fHighIndex = Integer.MAX_VALUE - 1;
|
private int fHighIndex = Integer.MAX_VALUE - 1;
|
||||||
private int fPendingUpdates;
|
private int fPendingUpdates;
|
||||||
|
private boolean fIsDone;
|
||||||
|
|
||||||
public MultiLevelUpdateHandler(Executor executor,
|
public MultiLevelUpdateHandler(Executor executor,
|
||||||
IVMModelProxy modelProxy,
|
IVMModelProxy modelProxy,
|
||||||
|
@ -150,11 +151,13 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
fLowIndex = low;
|
fLowIndex = low;
|
||||||
fHighIndex = high;
|
fHighIndex = high;
|
||||||
}
|
}
|
||||||
boolean isDone() {
|
|
||||||
return fStack.isEmpty();
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void done() {
|
public synchronized void done() {
|
||||||
|
assert !fIsDone;
|
||||||
|
if (fIsDone) {
|
||||||
|
// ignore gracefully
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
fExecutor.execute(new DsfRunnable() {
|
fExecutor.execute(new DsfRunnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -180,6 +183,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
||||||
fStack.clear();
|
fStack.clear();
|
||||||
}
|
}
|
||||||
if (fStack.isEmpty()) {
|
if (fStack.isEmpty()) {
|
||||||
|
fIsDone = true;
|
||||||
fRequestMonitor.setDoneCount(fPendingUpdates);
|
fRequestMonitor.setDoneCount(fPendingUpdates);
|
||||||
super.done();
|
super.done();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue