Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2009-01-05 20:44:32 +0000
committerCurtis Windatt2009-01-05 20:44:32 +0000
commit3360cca3d63666862720c90894a7083947bb0419 (patch)
tree2d04031bfc85c13c67b7199f78acd452577cca42 /org.eclipse.ui.console
parent4c85af3f8b423f5be8d7b9f1f21a8ceaa9e903f7 (diff)
downloadeclipse.platform.debug-3360cca3d63666862720c90894a7083947bb0419.tar.gz
eclipse.platform.debug-3360cca3d63666862720c90894a7083947bb0419.tar.xz
eclipse.platform.debug-3360cca3d63666862720c90894a7083947bb0419.zip
Bug 259107 - [console] Console Deadlock when too much information written
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259107
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
index b12b84c41..142cc7c00 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation 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
@@ -29,6 +29,7 @@ import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsoleDocumentPartitioner;
import org.eclipse.ui.console.IOConsole;
@@ -458,11 +459,24 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
}
- if (fBuffer > 160000) {
- try {
- pendingPartitions.wait();
- } catch (InterruptedException e) {
- }
+ if (fBuffer > 160000) {
+ if(Display.getCurrent() == null){
+ try {
+ pendingPartitions.wait();
+ } catch (InterruptedException e) {
+ }
+ } else {
+ /*
+ * if we are in UI thread we cannot lock it, so spin event
+ * loop. The caller will see this as locking but UI will
+ * stay responsive.
+ */
+ while(fBuffer != 0){
+ if(!Display.getDefault().readAndDispatch()){
+ Display.getDefault().sleep();
+ }
+ }
+ }
}
}
}

Back to the top