Use daemon thread to avoid blocking JVM shutdown (#605)

This commit is contained in:
Simon Legner
2020-06-23 12:48:11 +02:00
committed by GitHub
parent 769c896e53
commit 2ca0fa4732
3 changed files with 3 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ public abstract class KeepAlive extends Thread {
this.conn = conn;
log = conn.getTransport().getConfig().getLoggerFactory().getLogger(getClass());
setName(name);
setDaemon(true);
}
public synchronized int getKeepAliveInterval() {

View File

@@ -42,6 +42,7 @@ public class PacketReader extends Thread {
log = engine.getLoggerFactory().getLogger(getClass());
this.in = engine.getSubsystem().getInputStream();
setName("sftp reader");
setDaemon(true);
}
private void readIntoBuffer(byte[] buf, int off, int len)

View File

@@ -30,6 +30,7 @@ public final class Reader
this.trans = trans;
log = trans.getConfig().getLoggerFactory().getLogger(getClass());
setName("reader");
setDaemon(true);
}
@Override