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,14 +133,19 @@ class IntraLineLoader extends EntryCreator<IntraLineDiffKey, IntraLineDiff> {
+ " comparing " + key.getBlobA().name() // + " comparing " + key.getBlobA().name() //
+ ".." + key.getBlobB().name() // + ".." + key.getBlobB().name() //
+ ". Killing " + thread.getName()); + ". Killing " + thread.getName());
forcefullyKillThreadInAnUglyWay();
return Result.TIMEOUT;
}
}
@SuppressWarnings("deprecation")
private void forcefullyKillThreadInAnUglyWay() {
try { try {
thread.stop(); thread.stop();
} catch (Throwable error) { } catch (Throwable error) {
// Ignore any reason the thread won't stop. // Ignore any reason the thread won't stop.
log.error("Cannot stop runaway thread " + thread.getName(), error); log.error("Cannot stop runaway thread " + thread.getName(), error);
} }
return Result.TIMEOUT;
}
} }
void end() { void end() {