* Fix indentation in Transactor.kill()
This commit is contained in:
parent
657b86dee5
commit
972bb8f232
1 changed files with 18 additions and 18 deletions
|
@ -413,32 +413,32 @@ public class Transactor extends Thread {
|
||||||
* Kill this transaction thread. Used as last measure only.
|
* Kill this transaction thread. Used as last measure only.
|
||||||
*/
|
*/
|
||||||
public synchronized void kill() {
|
public synchronized void kill() {
|
||||||
killed = true;
|
killed = true;
|
||||||
interrupt();
|
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(1000);
|
join(1000);
|
||||||
} catch (InterruptedException ir) {
|
} catch (InterruptedException ir) {
|
||||||
// interrupted by other thread
|
// interrupted by other thread
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAlive() && "true".equals(nmgr.app.getProperty("requestTimeoutStop"))) {
|
if (isAlive() && "true".equals(nmgr.app.getProperty("requestTimeoutStop"))) {
|
||||||
// still running - check if we ought to stop() it
|
// still running - check if we ought to stop() it
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
if (isAlive()) {
|
if (isAlive()) {
|
||||||
// thread is still running, pull emergency break
|
// thread is still running, pull emergency break
|
||||||
nmgr.app.logEvent("Stopping Thread for Transactor " + this);
|
nmgr.app.logEvent("Stopping Thread for Transactor " + this);
|
||||||
stop();
|
stop();
|
||||||
}
|
|
||||||
} catch (InterruptedException ir) {
|
|
||||||
// interrupted by other thread
|
|
||||||
}
|
}
|
||||||
|
} catch (InterruptedException ir) {
|
||||||
|
// interrupted by other thread
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue