diff options
author | Jonathan Bauer | 2019-10-22 14:29:51 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-10-22 14:29:51 +0200 |
commit | 73c0ed09487228a41901f2b827dcd5eb190bc2dd (patch) | |
tree | 189418bb3044c9345151fab91f6adc869028cbd7 /src/main/java/org/openslx/filetransfer/util/HashChecker.java | |
parent | Clean up project (diff) | |
parent | Json: Fix deserialization of bools in Thrift classes (diff) | |
download | master-sync-shared-73c0ed09487228a41901f2b827dcd5eb190bc2dd.tar.gz master-sync-shared-73c0ed09487228a41901f2b827dcd5eb190bc2dd.tar.xz master-sync-shared-73c0ed09487228a41901f2b827dcd5eb190bc2dd.zip |
Merge branch 'master' into qemu
Diffstat (limited to 'src/main/java/org/openslx/filetransfer/util/HashChecker.java')
-rw-r--r-- | src/main/java/org/openslx/filetransfer/util/HashChecker.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/filetransfer/util/HashChecker.java b/src/main/java/org/openslx/filetransfer/util/HashChecker.java index bddf829..f6b27f7 100644 --- a/src/main/java/org/openslx/filetransfer/util/HashChecker.java +++ b/src/main/java/org/openslx/filetransfer/util/HashChecker.java @@ -106,7 +106,8 @@ public class HashChecker execCallback( task, HashResult.FAILURE ); return true; } - if ( queue.isEmpty() ) { + if ( threads.isEmpty() ) { + // This is the first thread -- keep it around CheckThread thread; try { thread = new CheckThread( false ); @@ -120,6 +121,7 @@ public class HashChecker } } if ( queue.remainingCapacity() <= 1 && threads.size() < Runtime.getRuntime().availableProcessors() ) { + // Queue starts to fill up -- add more temporary threads try { CheckThread thread = new CheckThread( true ); thread.start(); |