--- a/src/Pure/Concurrent/isabelle_thread.scala Sat Aug 22 14:56:33 2020 +0200
+++ b/src/Pure/Concurrent/isabelle_thread.scala Sat Aug 22 20:09:11 2020 +0200
@@ -7,7 +7,7 @@
package isabelle
-import java.util.concurrent.{ThreadPoolExecutor, TimeUnit, LinkedBlockingQueue, ThreadFactory}
+import java.util.concurrent.{ThreadPoolExecutor, TimeUnit, LinkedBlockingQueue}
object Isabelle_Thread
@@ -69,10 +69,15 @@
/* thread pool */
+ def max_threads(): Int =
+ {
+ val m = Value.Int.unapply(System.getProperty("isabelle.threads", "0")) getOrElse 0
+ if (m > 0) m else (Runtime.getRuntime.availableProcessors max 1) min 8
+ }
+
lazy val pool: ThreadPoolExecutor =
{
- val m = Value.Int.unapply(System.getProperty("isabelle.threads", "0")) getOrElse 0
- val n = if (m > 0) m else (Runtime.getRuntime.availableProcessors max 1) min 8
+ val n = max_threads()
val executor =
new ThreadPoolExecutor(n, n, 2500L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue[Runnable])
executor.setThreadFactory(