fix "not resumed" assertion

This commit is contained in:
Eugene Zhuravlev
2013-11-03 15:34:40 +01:00
parent f248ffc5a0
commit e5f84100c8
@@ -67,16 +67,23 @@ public abstract class SuspendContextCommandImpl extends DebuggerCommandImpl {
}
finally{
suspendContext.myInProgress = false;
SuspendContextCommandImpl postponed = suspendContext.pollPostponedCommand();
if (postponed != null) {
final Stack<SuspendContextCommandImpl> stack = new Stack<SuspendContextCommandImpl>();
while (postponed != null) {
stack.push(postponed);
postponed = suspendContext.pollPostponedCommand();
if (suspendContext.isResumed()) {
for (SuspendContextCommandImpl postponed = suspendContext.pollPostponedCommand(); postponed != null; postponed = suspendContext.pollPostponedCommand()) {
postponed.notifyCancelled();
}
final DebuggerManagerThreadImpl managerThread = suspendContext.getDebugProcess().getManagerThread();
while (!stack.isEmpty()) {
managerThread.pushBack(stack.pop());
}
else {
SuspendContextCommandImpl postponed = suspendContext.pollPostponedCommand();
if (postponed != null) {
final Stack<SuspendContextCommandImpl> stack = new Stack<SuspendContextCommandImpl>();
while (postponed != null) {
stack.push(postponed);
postponed = suspendContext.pollPostponedCommand();
}
final DebuggerManagerThreadImpl managerThread = suspendContext.getDebugProcess().getManagerThread();
while (!stack.isEmpty()) {
managerThread.pushBack(stack.pop());
}
}
}
}