diff options
author | Viktor Klang <viktor.klang@gmail.com> | 2012-07-13 18:16:31 +0200 |
---|---|---|
committer | Viktor Klang <viktor.klang@gmail.com> | 2012-07-13 18:16:31 +0200 |
commit | 7e0b9e8effaebbb6413e4cc63789b8f86428a684 (patch) | |
tree | bc0b7aef6fd1722ef3f8d8ad31a776bb701a375c /src | |
parent | 47652e692a5bdcbc18de2881e86267d37757751d (diff) | |
download | scala-7e0b9e8effaebbb6413e4cc63789b8f86428a684.tar.gz scala-7e0b9e8effaebbb6413e4cc63789b8f86428a684.tar.bz2 scala-7e0b9e8effaebbb6413e4cc63789b8f86428a684.zip |
Changing to scala.concurrent.context. as namespace for the system properties for the global execution context
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/concurrent/impl/ExecutionContextImpl.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/library/scala/concurrent/impl/ExecutionContextImpl.scala b/src/library/scala/concurrent/impl/ExecutionContextImpl.scala index 6c4145e2d5..98f821652f 100644 --- a/src/library/scala/concurrent/impl/ExecutionContextImpl.scala +++ b/src/library/scala/concurrent/impl/ExecutionContextImpl.scala @@ -59,15 +59,14 @@ private[scala] class ExecutionContextImpl private[impl] (es: Executor, reporter: def range(floor: Int, desired: Int, ceiling: Int): Int = if (ceiling < floor) range(ceiling, desired, floor) else scala.math.min(scala.math.max(desired, floor), ceiling) - val minThreads = getInt("scala.concurrent.ec.minThreads", _.toInt) - val maxThreads = getInt("scala.concurrent.ec.maxThreads", _.toInt) - val numThreads = getInt("scala.concurrent.ec.numThreads", { + val desiredParallelism = range( + getInt("scala.concurrent.context.minThreads", _.toInt), + getInt("scala.concurrent.context.numThreads", { case null | "" => Runtime.getRuntime.availableProcessors case s if s.charAt(0) == 'x' => (Runtime.getRuntime.availableProcessors * s.substring(1).toDouble).ceil.toInt case other => other.toInt - }) - - val desiredParallelism = range(minThreads, numThreads, maxThreads) + }), + getInt("scala.concurrent.context.maxThreads", _.toInt)) val threadFactory = new DefaultThreadFactory(daemonic = true) |