Skip to content

Commit

Permalink
Don't allow the parallelism to be smaller than 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcyu committed Mar 10, 2021
1 parent 6889229 commit 71adeca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ private JPanel createPanelOptions() {
uiSpinnerRam = new UiSpinnerInt(0, 0, 1024, 1, 3);
FormEntry feRam = fe(uiSpinnerRam, "ram").label("RAM (GB, 0=auto)").tooltip("Leave at zero to use a reasonable amount automatically").create();
final int maxProcessors = 128;
uiSpinnerThreads = new UiSpinnerInt(Math.min(Runtime.getRuntime().availableProcessors() - 1, maxProcessors), 0, maxProcessors, 1);
uiSpinnerThreads = new UiSpinnerInt(Math.max(1, Math.min(Runtime.getRuntime().availableProcessors() - 1, maxProcessors)), 0, maxProcessors, 1);
FormEntry feThreads = fe(uiSpinnerThreads, "threads").label("Parallelism").create();

mu.add(p, feRam.label()).split();
Expand Down

0 comments on commit 71adeca

Please sign in to comment.