Skip to content

Commit ebc3636

Browse files
author
aleksandar
committed
Deprecating some traits in scala.concurrent.
1 parent 09deeec commit ebc3636

File tree

10 files changed

+23
-5
lines changed

10 files changed

+23
-5
lines changed

src/library/scala/concurrent/Channel.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Channel[A] {
2323
private var written = new LinkedList[A] // FIFO buffer, realized through
2424
private var lastWritten = written // aliasing of a linked list
2525
private var nreaders = 0
26-
26+
2727
/**
2828
* @param x ...
2929
*/
@@ -33,7 +33,7 @@ class Channel[A] {
3333
lastWritten = lastWritten.next
3434
if (nreaders > 0) notify()
3535
}
36-
36+
3737
def read: A = synchronized {
3838
while (written.next == null) {
3939
try {
@@ -46,4 +46,5 @@ class Channel[A] {
4646
written = written.next
4747
x
4848
}
49+
4950
}

src/library/scala/concurrent/DelayedLazyVal.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,23 @@ package scala.concurrent
2626
class DelayedLazyVal[T](f: () => T, body: => Unit) {
2727
@volatile private[this] var _isDone = false
2828
private[this] lazy val complete = f()
29-
29+
3030
/** Whether the computation is complete.
3131
*
3232
* @return true if the computation is complete.
3333
*/
3434
def isDone = _isDone
35-
35+
3636
/** The current result of f(), or the final result if complete.
3737
*
3838
* @return the current value
3939
*/
4040
def apply(): T = if (isDone) complete else f()
41-
41+
42+
// TODO replace with scala.concurrent.future { ... }
4243
ops.future {
4344
body
4445
_isDone = true
4546
}
47+
4648
}

src/library/scala/concurrent/Future.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import scala.collection.generic.CanBuildFrom
4141
* }
4242
* }}}
4343
*
44+
* @author Philipp Haller, Heather Miller, Aleksandar Prokopec, Viktor Klang
45+
*
4446
* @define multipleCallbacks
4547
* Multiple callbacks may be registered; there is no guarantee that they will be
4648
* executed in a particular order.

src/library/scala/concurrent/FutureTaskRunner.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ package scala.concurrent
1313
*
1414
* @author Philipp Haller
1515
*/
16+
@deprecated("Use `ExecutionContext`s instead.", "2.10.0")
1617
trait FutureTaskRunner extends TaskRunner {
1718

1819
/** The type of the futures that the underlying task runner supports.

src/library/scala/concurrent/JavaConversions.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import java.util.concurrent.{ExecutorService, Executor}
1717
*/
1818
object JavaConversions {
1919

20+
@deprecated("Use `asExecutionContext` instead.", "2.10.0")
2021
implicit def asTaskRunner(exec: ExecutorService): FutureTaskRunner =
2122
new ThreadPoolRunner {
2223
override protected def executor =
@@ -26,6 +27,7 @@ object JavaConversions {
2627
exec.shutdown()
2728
}
2829

30+
@deprecated("Use `asExecutionContext` instead.", "2.10.0")
2931
implicit def asTaskRunner(exec: Executor): TaskRunner =
3032
new TaskRunner {
3133
type Task[T] = Runnable
@@ -46,4 +48,9 @@ object JavaConversions {
4648
// do nothing
4749
}
4850
}
51+
52+
implicit def asExecutionContext(exec: ExecutorService): ExecutionContext = null // TODO
53+
54+
implicit def asExecutionContext(exec: Executor): ExecutionContext = null // TODO
55+
4956
}

src/library/scala/concurrent/ManagedBlocker.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package scala.concurrent
1212
*
1313
* @author Philipp Haller
1414
*/
15+
@deprecated("Not used.", "2.10.0")
1516
trait ManagedBlocker {
1617

1718
/**

src/library/scala/concurrent/TaskRunner.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package scala.concurrent
1212
*
1313
* @author Philipp Haller
1414
*/
15+
@deprecated("Use `ExecutionContext`s instead.", "2.10.0")
1516
trait TaskRunner {
1617

1718
type Task[T]

src/library/scala/concurrent/TaskRunners.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import java.util.concurrent.{ThreadPoolExecutor, LinkedBlockingQueue, TimeUnit}
1414
*
1515
* @author Philipp Haller
1616
*/
17+
@deprecated("Use `ExecutionContext`s instead.", "2.10.0")
1718
object TaskRunners {
1819

1920
implicit val threadRunner: FutureTaskRunner =

src/library/scala/concurrent/ThreadPoolRunner.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import java.util.concurrent.{ExecutorService, Callable, TimeUnit}
1515
*
1616
* @author Philipp Haller
1717
*/
18+
@deprecated("Use `ExecutionContext`s instead.", "2.10.0")
1819
trait ThreadPoolRunner extends FutureTaskRunner {
1920

2021
type Task[T] = Callable[T] with Runnable

src/library/scala/concurrent/ops.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import scala.util.control.Exception.allCatch
1515
*
1616
* @author Martin Odersky, Stepan Koltsov, Philipp Haller
1717
*/
18+
@deprecated("Use `future` instead.", "2.10.0")
1819
object ops
1920
{
2021
val defaultRunner: FutureTaskRunner = TaskRunners.threadRunner

0 commit comments

Comments
 (0)