doesnt use thead.stop() anymore

This commit is contained in:
hns 2001-01-25 20:57:30 +00:00
parent d807e4a340
commit 857544fd9b

View file

@ -194,11 +194,13 @@ public class Transactor extends Thread {
if (active) { if (active) {
active = false; active = false;
if (txn != null) {
nmgr.db.abortTransaction (txn); nmgr.db.abortTransaction (txn);
txn = null; txn = null;
} }
IServer.getLogger().log (tname+" aborted after "+(System.currentTimeMillis()-tstart)+" millis"); IServer.getLogger().log (tname+" aborted after "+(System.currentTimeMillis()-tstart)+" millis");
} }
}
public synchronized void kill () { public synchronized void kill () {
killed = true; killed = true;
@ -206,22 +208,15 @@ public class Transactor extends Thread {
// evaluator, so we can hope that it stops without doing anything else. // evaluator, so we can hope that it stops without doing anything else.
try { try {
join (500); join (500);
} catch (InterruptedException ir) { } catch (InterruptedException ir) {}
Thread.currentThread().interrupt();
}
// Interrupt the thread if it has not noticed the flag (e.g. because it is busy // Interrupt the thread if it has not noticed the flag (e.g. because it is busy
// reading from a network socket). // reading from a network socket).
if (isAlive()) { if (isAlive()) {
interrupt (); interrupt ();
try { try {
join (3000); join (1000);
} catch (InterruptedException ignore) { } catch (InterruptedException ir) {}
Thread.currentThread().interrupt();
}
if (isAlive())
// Sorry to be so rude...
stop (new TimeoutException());
} }
} }