1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2015, LAMP/EPFL and Typesafe, Inc. **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala.concurrent
import java.util.{concurrent => juc}
import java.util.Collection
package object forkjoin {
@deprecated("Use java.util.concurrent.ForkJoinPool directly, instead of this alias.", "2.12.0")
type ForkJoinPool = juc.ForkJoinPool
@deprecated("Use java.util.concurrent.ForkJoinPool directly, instead of this alias.", "2.12.0")
object ForkJoinPool {
type ForkJoinWorkerThreadFactory = juc.ForkJoinPool.ForkJoinWorkerThreadFactory
type ManagedBlocker = juc.ForkJoinPool.ManagedBlocker
val defaultForkJoinWorkerThreadFactory: ForkJoinWorkerThreadFactory = juc.ForkJoinPool.defaultForkJoinWorkerThreadFactory
def managedBlock(blocker: ManagedBlocker): Unit = juc.ForkJoinPool.managedBlock(blocker)
}
@deprecated("Use java.util.concurrent.ForkJoinTask directly, instead of this alias.", "2.12.0")
type ForkJoinTask[T] = juc.ForkJoinTask[T]
@deprecated("Use java.util.concurrent.ForkJoinTask directly, instead of this alias.", "2.12.0")
object ForkJoinTask {
def adapt(runnable: Runnable): ForkJoinTask[_] = juc.ForkJoinTask.adapt(runnable)
def adapt[T](callable: juc.Callable[_ <: T]): ForkJoinTask[T] = juc.ForkJoinTask.adapt(callable)
def adapt[T](runnable: Runnable, result: T): ForkJoinTask[T] = juc.ForkJoinTask.adapt(runnable, result)
def getPool(): ForkJoinPool = juc.ForkJoinTask.getPool
def getQueuedTaskCount(): Int = juc.ForkJoinTask.getQueuedTaskCount
def getSurplusQueuedTaskCount(): Int = juc.ForkJoinTask.getSurplusQueuedTaskCount
def helpQuiesce(): Unit = juc.ForkJoinTask.helpQuiesce
def inForkJoinPool(): Boolean = juc.ForkJoinTask.inForkJoinPool
def invokeAll[T <: ForkJoinTask[_]](tasks: Collection[T]): Collection[T] = juc.ForkJoinTask.invokeAll(tasks)
def invokeAll[T](t1: ForkJoinTask[T]): Unit = juc.ForkJoinTask.invokeAll(t1)
def invokeAll[T](tasks: ForkJoinTask[T]*): Unit = juc.ForkJoinTask.invokeAll(tasks: _*)
}
@deprecated("Use java.util.concurrent.ForkJoinWorkerThread directly, instead of this alias.", "2.12.0")
type ForkJoinWorkerThread = juc.ForkJoinWorkerThread
@deprecated("Use java.util.concurrent.LinkedTransferQueue directly, instead of this alias.", "2.12.0")
type LinkedTransferQueue[T] = juc.LinkedTransferQueue[T]
@deprecated("Use java.util.concurrent.RecursiveAction directly, instead of this alias.", "2.12.0")
type RecursiveAction = juc.RecursiveAction
@deprecated("Use java.util.concurrent.RecursiveTask directly, instead of this alias.", "2.12.0")
type RecursiveTask[T] = juc.RecursiveTask[T]
@deprecated("Use java.util.concurrent.ThreadLocalRandom directly, instead of this alias.", "2.12.0")
type ThreadLocalRandom = juc.ThreadLocalRandom
@deprecated("Use java.util.concurrent.ThreadLocalRandom directly, instead of this alias.", "2.12.0")
object ThreadLocalRandom {
// For source compatibility, current must declare the empty argument list.
// Having no argument list makes more sense since it doesn't have any side effects,
// but existing callers will break if they invoked it as `current()`.
def current() = juc.ThreadLocalRandom.current
}
}
|