mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 02:05: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
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -273,13 +273,10 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider
|
|||
new VMChildrenCountUpdate(update, childrenCountMultiReqMon.add(new ViewerDataRequestMonitor<Integer>(
|
||||
getVMProvider().getExecutor(), update) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
counts[nodeIndex] = getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
super.handleCompleted();
|
||||
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
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -123,6 +123,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
|||
private int fLowIndex = 0;
|
||||
private int fHighIndex = Integer.MAX_VALUE - 1;
|
||||
private int fPendingUpdates;
|
||||
private boolean fIsDone;
|
||||
|
||||
public MultiLevelUpdateHandler(Executor executor,
|
||||
IVMModelProxy modelProxy,
|
||||
|
@ -150,11 +151,13 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
|||
fLowIndex = low;
|
||||
fHighIndex = high;
|
||||
}
|
||||
boolean isDone() {
|
||||
return fStack.isEmpty();
|
||||
}
|
||||
@Override
|
||||
public synchronized void done() {
|
||||
assert !fIsDone;
|
||||
if (fIsDone) {
|
||||
// ignore gracefully
|
||||
return;
|
||||
}
|
||||
try {
|
||||
fExecutor.execute(new DsfRunnable() {
|
||||
public void run() {
|
||||
|
@ -180,6 +183,7 @@ class MultiLevelUpdateHandler extends DataRequestMonitor<List<Object>> {
|
|||
fStack.clear();
|
||||
}
|
||||
if (fStack.isEmpty()) {
|
||||
fIsDone = true;
|
||||
fRequestMonitor.setDoneCount(fPendingUpdates);
|
||||
super.done();
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue