mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 291086 - [vm] AbstractVMProvider.handleEvent() should honor request monitor's cancel request.
This commit is contained in:
parent
de96c0f149
commit
17fe60355e
1 changed files with 15 additions and 3 deletions
|
@ -327,9 +327,13 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene
|
||||||
// that should be handled. If there are, doHandleEvent calls itself
|
// that should be handled. If there are, doHandleEvent calls itself
|
||||||
// to process the next event in the queue.
|
// to process the next event in the queue.
|
||||||
assert queue.fCurrentEvent == null && queue.fCurrentRm == null;
|
assert queue.fCurrentEvent == null && queue.fCurrentRm == null;
|
||||||
|
|
||||||
queue.fCurrentEvent = eventInfo;
|
// We intentionally do not give the client RM as the parent RM
|
||||||
queue.fCurrentRm = new RequestMonitor(getExecutor(), null) {
|
// for the queue.fCurrentRm. This is because fCurrentRm may get
|
||||||
|
// canceled if a new event comes and overrides it. If client RM
|
||||||
|
// was the parent, it would lead to the inconsistent situation where
|
||||||
|
// a sub-RM is canceled but the parent is not.
|
||||||
|
final RequestMonitor queueRm = new RequestMonitor(getExecutor(), null) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleCompleted() {
|
protected void handleCompleted() {
|
||||||
eventInfo.fClientRm.done();
|
eventInfo.fClientRm.done();
|
||||||
|
@ -341,6 +345,14 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
eventInfo.fClientRm.addCancelListener(new ICanceledListener() {
|
||||||
|
public void requestCanceled(RequestMonitor rm) {
|
||||||
|
queueRm.cancel();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
queue.fCurrentEvent = eventInfo;
|
||||||
|
queue.fCurrentRm = queueRm;
|
||||||
handleEvent(proxyStrategy, eventInfo.fEvent, queue.fCurrentRm);
|
handleEvent(proxyStrategy, eventInfo.fEvent, queue.fCurrentRm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue