Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-04-06 09:45:20 -0400
committerDarin Wright2010-04-06 09:45:20 -0400
commit57914dd7b782f1bbfb1f6f105fd1140f70a042bc (patch)
tree9f6db00634e5d22201d6ed9bca903b0bb32be2d9
parent91084b37366a18d1076256124972c8fbc7452936 (diff)
downloadeclipse.platform.debug-R3_2_maintenance.tar.gz
eclipse.platform.debug-R3_2_maintenance.tar.xz
eclipse.platform.debug-R3_2_maintenance.zip
[3.2.2+] Bug 306914 - Possible deadlock when big chunk of data is written by the processR3_2_maintenance
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java44
1 files changed, 25 insertions, 19 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
index df883e24a..b036c00f6 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 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
@@ -211,18 +211,20 @@ public class ConsoleManager implements IConsoleManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#addConsoles(org.eclipse.ui.console.IConsole[])
*/
- public synchronized void addConsoles(IConsole[] consoles) {
+ public void addConsoles(IConsole[] consoles) {
List added = new ArrayList(consoles.length);
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if(console instanceof TextConsole) {
- TextConsole ioconsole = (TextConsole)console;
- createPatternMatchListeners(ioconsole);
- }
- if (!fConsoles.contains(console)) {
- fConsoles.add(console);
- added.add(console);
- }
+ synchronized (fConsoles) {
+ for (int i = 0; i < consoles.length; i++) {
+ IConsole console = consoles[i];
+ if(console instanceof TextConsole) {
+ TextConsole ioconsole = (TextConsole)console;
+ createPatternMatchListeners(ioconsole);
+ }
+ if (!fConsoles.contains(console)) {
+ fConsoles.add(console);
+ added.add(console);
+ }
+ }
}
if (!added.isEmpty()) {
fireUpdate((IConsole[])added.toArray(new IConsole[added.size()]), ADDED);
@@ -232,12 +234,14 @@ public class ConsoleManager implements IConsoleManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#removeConsoles(org.eclipse.ui.console.IConsole[])
*/
- public synchronized void removeConsoles(IConsole[] consoles) {
+ public void removeConsoles(IConsole[] consoles) {
List removed = new ArrayList(consoles.length);
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if (fConsoles.remove(console)) {
- removed.add(console);
+ synchronized (fConsoles) {
+ for (int i = 0; i < consoles.length; i++) {
+ IConsole console = consoles[i];
+ if (fConsoles.remove(console)) {
+ removed.add(console);
+ }
}
}
if (!removed.isEmpty()) {
@@ -248,8 +252,10 @@ public class ConsoleManager implements IConsoleManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#getConsoles()
*/
- public synchronized IConsole[] getConsoles() {
- return (IConsole[])fConsoles.toArray(new IConsole[fConsoles.size()]);
+ public IConsole[] getConsoles() {
+ synchronized (fConsoles) {
+ return (IConsole[])fConsoles.toArray(new IConsole[fConsoles.size()]);
+ }
}
/**

Back to the top