Do not override user-specified max.bg.threads

This commit is contained in:
embeddedt 2025-08-01 18:41:55 -04:00
parent 44322a7d07
commit 12a0414f61
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -95,6 +95,10 @@ public class ModernFixMixinPlugin implements IMixinConfigPlugin {
}
private void computeBetterThreadCount() {
// Allow user-provided thread count to take precedence
if (System.getProperty("max.bg.threads") != null) {
return;
}
// Server thread + client thread + GC thread
int reservedCores = 3;
int availableBackgroundCores = Math.max(1, Runtime.getRuntime().availableProcessors() - reservedCores);