View | Details | Raw Unified | Return to bug 228528
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ProcessTaskManager.java (-8 / +19 lines)
Lines 109-115 Link Here
109
109
110
			unitToProcess = this.compiler.getUnitToProcess(this.unitIndex);
110
			unitToProcess = this.compiler.getUnitToProcess(this.unitIndex);
111
			if (unitToProcess == null) {
111
			if (unitToProcess == null) {
112
				shutdown();
112
				this.processingThread = null;
113
				return;
113
				return;
114
			}
114
			}
115
			index = this.unitIndex++;
115
			index = this.unitIndex++;
Lines 127-140 Link Here
127
					}));
127
					}));
128
			this.compiler.process(unitToProcess, index);
128
			this.compiler.process(unitToProcess, index);
129
		} catch (AbortCompilation e) {
129
		} catch (AbortCompilation e) {
130
			shutdown();
130
			this.processingThread = null;
131
			this.compiler.handleInternalException(e, unitToProcess);
131
			this.compiler.handleInternalException(e, unitToProcess);
132
			return;
132
		} catch (Error e) {
133
		} catch (Error e) {
133
			shutdown();
134
			this.processingThread = null;
134
			this.compiler.handleInternalException(e, unitToProcess, null);
135
			this.compiler.handleInternalException(e, unitToProcess, null);
135
			throw e; // rethrow
136
			throw e; // rethrow
136
		} catch (RuntimeException e) {
137
		} catch (RuntimeException e) {
137
			shutdown();
138
			this.processingThread = null;
138
			this.compiler.handleInternalException(e, unitToProcess, null);
139
			this.compiler.handleInternalException(e, unitToProcess, null);
139
			throw e; // rethrow
140
			throw e; // rethrow
140
		} finally {
141
		} finally {
Lines 145-154 Link Here
145
	}
146
	}
146
}
147
}
147
148
148
public synchronized void shutdown() {
149
public void shutdown() {
149
	if (this.processingThread != null) {
150
	try {
150
		notifyAll();
151
		Thread t = null;
151
		this.processingThread = null;
152
		synchronized (this) {
153
			if (this.processingThread != null) {
154
				t = this.processingThread;
155
				this.processingThread = null;
156
				notifyAll();
157
			}
158
		}
159
		if (t != null)
160
			t.join();
161
	} catch (InterruptedException ignored) {
162
		// ignore
152
	}
163
	}
153
}
164
}
154
}
165
}
(-)compiler/org/eclipse/jdt/internal/compiler/Compiler.java (+6 lines)
Lines 485-495 Link Here
485
				}
485
				}
486
			}
486
			}
487
		} catch (AbortCompilation e) {
487
		} catch (AbortCompilation e) {
488
			if (processingTask != null)
489
				processingTask.shutdown();
488
			this.handleInternalException(e, unit);
490
			this.handleInternalException(e, unit);
489
		} catch (Error e) {
491
		} catch (Error e) {
492
			if (processingTask != null)
493
				processingTask.shutdown();
490
			this.handleInternalException(e, unit, null);
494
			this.handleInternalException(e, unit, null);
491
			throw e; // rethrow
495
			throw e; // rethrow
492
		} catch (RuntimeException e) {
496
		} catch (RuntimeException e) {
497
			if (processingTask != null)
498
				processingTask.shutdown();
493
			this.handleInternalException(e, unit, null);
499
			this.handleInternalException(e, unit, null);
494
			throw e; // rethrow
500
			throw e; // rethrow
495
		} finally {
501
		} finally {

Return to bug 228528