doesnt use thead.stop() anymore
This commit is contained in:
parent
d807e4a340
commit
857544fd9b
1 changed files with 8 additions and 13 deletions
|
@ -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());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue