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 |
} |