Optionally skip shutdown wait

This commit is contained in:
Andrea Cavalli 2021-10-21 00:52:57 +02:00
parent 30c74a6ab4
commit 887d95f2c2
1 changed files with 3 additions and 1 deletions

View File

@ -210,7 +210,9 @@ public final class ResponseReceiver extends Thread implements AutoCloseable {
public void onJVMShutdown() throws InterruptedException {
if (startCalled.get()) {
if (this.jvmShutdown.compareAndSet(false, true)) {
this.closeWait.await();
if (Boolean.parseBoolean(System.getProperty("it.tdlight.pauseShutdownUntilAllClosed", "true"))) {
this.closeWait.await();
}
}
}
}