src/Pure/Concurrent/multithreading.scala
changeset 79650 65ef68bab8d6
parent 79613 7a432595fb66
child 79758 68f2fe632b4c
--- a/src/Pure/Concurrent/multithreading.scala	Sat Feb 17 17:12:37 2024 +0100
+++ b/src/Pure/Concurrent/multithreading.scala	Sat Feb 17 17:23:22 2024 +0100
@@ -42,8 +42,10 @@
 
   /* max_threads */
 
-  def max_threads(): Int = {
-    val m = Value.Int.unapply(System.getProperty("isabelle.threads", "0")) getOrElse 0
-    if (m > 0) m else num_processors() min 8
+  def max_threads(
+    value: Int = Value.Int.unapply(System.getProperty("isabelle.threads", "0")) getOrElse 0,
+    default: => Int = num_processors()
+  ): Int = {
+    if (value > 0) value else (default max 1) min 8
   }
 }