Fix deprecation warning for Thread.stop()

Change-Id: Ib1957f3a50c5e65ab5680bb07b43efe368b85fa9
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2011-05-19 08:41:11 -07:00
parent 27a8ebf0ce
commit 054f68c177

View File

@@ -133,16 +133,21 @@ class IntraLineLoader extends EntryCreator<IntraLineDiffKey, IntraLineDiff> {
+ " comparing " + key.getBlobA().name() //
+ ".." + key.getBlobB().name() //
+ ". Killing " + thread.getName());
try {
thread.stop();
} catch (Throwable error) {
// Ignore any reason the thread won't stop.
log.error("Cannot stop runaway thread " + thread.getName(), error);
}
forcefullyKillThreadInAnUglyWay();
return Result.TIMEOUT;
}
}
@SuppressWarnings("deprecation")
private void forcefullyKillThreadInAnUglyWay() {
try {
thread.stop();
} catch (Throwable error) {
// Ignore any reason the thread won't stop.
log.error("Cannot stop runaway thread " + thread.getName(), error);
}
}
void end() {
if (!input.offer(Input.END_THREAD)) {
log.error("Cannot gracefully stop thread " + thread.getName());