mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 11:44:36 +00:00
#776 FFDec stop working at all after setting "number of threads" to 0 fixed
This commit is contained in:
@@ -1139,7 +1139,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
logger.log(Level.SEVERE, "Error during ABC export", ex);
|
||||
}
|
||||
} else {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(Configuration.parallelThreadCount.get());
|
||||
ExecutorService executor = Executors.newFixedThreadPool(Configuration.getParallelThreadCount());
|
||||
List<Future<File>> futureResults = new ArrayList<>();
|
||||
for (MyEntry<ClassPath, ScriptPack> item : packs) {
|
||||
Future<File> future = executor.submit(new ExportPackTask(handler, cnt, packs.size(), item.getKey(), item.getValue(), outdir, exportMode, parallel));
|
||||
|
||||
@@ -1059,7 +1059,7 @@ public class SWFInputStream implements AutoCloseable {
|
||||
ExecutorService executor = null;
|
||||
List<Future<Tag>> futureResults = new ArrayList<>();
|
||||
if (parallel) {
|
||||
executor = Executors.newFixedThreadPool(Configuration.parallelThreadCount.get());
|
||||
executor = Executors.newFixedThreadPool(Configuration.getParallelThreadCount());
|
||||
futureResults = new ArrayList<>();
|
||||
}
|
||||
List<Tag> tags = new ArrayList<>();
|
||||
|
||||
@@ -169,7 +169,7 @@ public class Traits implements Serializable {
|
||||
task.call();
|
||||
}
|
||||
} else {
|
||||
ExecutorService executor = Executors.newFixedThreadPool(Configuration.parallelThreadCount.get());
|
||||
ExecutorService executor = Executors.newFixedThreadPool(Configuration.getParallelThreadCount());
|
||||
List<Future<Void>> futureResults = null;
|
||||
|
||||
futureResults = new ArrayList<>();
|
||||
|
||||
@@ -690,6 +690,15 @@ public class Configuration {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static int getParallelThreadCount() {
|
||||
int count = parallelThreadCount.get();
|
||||
if (count < 2) {
|
||||
count = 2;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
public static File getFlashLibPath() {
|
||||
String home = getFFDecHome();
|
||||
File libsdir = new File(home + "flashlib");
|
||||
|
||||
Reference in New Issue
Block a user