Skip to content

Commit 0538ca5

Browse files
committed
Merge remote-tracking branches 'heathermiller/issue/5522' and 'heathermiller/issue/5523' into develop
3 parents 4573e06 + ac7376e + 76e9da2 commit 0538ca5

File tree

13 files changed

+4826
-3448
lines changed

13 files changed

+4826
-3448
lines changed

src/actors/scala/actors/scheduler/DrainableForkJoinPool.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ package scheduler
44
import java.util.Collection
55
import scala.concurrent.forkjoin.{ForkJoinPool, ForkJoinTask}
66

7-
private class DrainableForkJoinPool extends ForkJoinPool {
7+
private class DrainableForkJoinPool(parallelism: Int, maxPoolSize: Int) extends ForkJoinPool(parallelism, ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true) {
88

9-
override def drainTasksTo(c: Collection[ForkJoinTask[_]]): Int =
9+
override def drainTasksTo(c: Collection[ _ >: ForkJoinTask[_]]): Int =
1010
super.drainTasksTo(c)
1111

1212
}

src/actors/scala/actors/scheduler/ForkJoinScheduler.scala

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ class ForkJoinScheduler(val initCoreSize: Int, val maxSize: Int, daemon: Boolean
3838
}
3939

4040
private def makeNewPool(): DrainableForkJoinPool = {
41-
val p = new DrainableForkJoinPool()
42-
// enable locally FIFO scheduling mode
43-
p.setAsyncMode(true)
44-
p.setParallelism(initCoreSize)
45-
p.setMaximumPoolSize(maxSize)
41+
val p = new DrainableForkJoinPool(initCoreSize, maxSize)
4642
Debug.info(this+": parallelism "+p.getParallelism())
47-
Debug.info(this+": max pool size "+p.getMaximumPoolSize())
4843
p
4944
}
5045

@@ -144,7 +139,7 @@ class ForkJoinScheduler(val initCoreSize: Int, val maxSize: Int, daemon: Boolean
144139
ForkJoinPool.managedBlock(new ForkJoinPool.ManagedBlocker {
145140
def block = blocker.block()
146141
def isReleasable() = blocker.isReleasable
147-
}, true)
142+
})
148143
}
149144

150145
/** Suspends the scheduler. All threads that were in use by the

src/forkjoin/scala/concurrent/forkjoin/ForkJoinPool.java

Lines changed: 2430 additions & 1409 deletions
Large diffs are not rendered by default.

src/forkjoin/scala/concurrent/forkjoin/ForkJoinTask.java

Lines changed: 1104 additions & 645 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)