Skip to content

Commit

Permalink
Use daemon thread to avoid blocking JVM shutdown (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 authored Jun 23, 2020
1 parent 769c896 commit 2ca0fa4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/schmizz/keepalive/KeepAlive.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected KeepAlive(ConnectionImpl conn, String name) {
this.conn = conn;
log = conn.getTransport().getConfig().getLoggerFactory().getLogger(getClass());
setName(name);
setDaemon(true);
}

public synchronized int getKeepAliveInterval() {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/schmizz/sshj/sftp/PacketReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public PacketReader(SFTPEngine engine) {
log = engine.getLoggerFactory().getLogger(getClass());
this.in = engine.getSubsystem().getInputStream();
setName("sftp reader");
setDaemon(true);
}

private void readIntoBuffer(byte[] buf, int off, int len)
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/schmizz/sshj/transport/Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public Reader(TransportImpl trans) {
this.trans = trans;
log = trans.getConfig().getLoggerFactory().getLogger(getClass());
setName("reader");
setDaemon(true);
}

@Override
Expand Down

0 comments on commit 2ca0fa4

Please sign in to comment.