From a17d409181aa8b1574fe1a24ba4b508d492f8d66 Mon Sep 17 00:00:00 2001 From: Simon Ochsenreither Date: Tue, 27 Oct 2015 13:05:49 +0100 Subject: SI-7566 Remove some private, deprecated remnants from scala-actors --- .../scala/concurrent/FutureTaskRunner.scala | 39 ----------------- src/library/scala/concurrent/ManagedBlocker.scala | 34 --------------- src/library/scala/concurrent/TaskRunner.scala | 27 ------------ .../scala/concurrent/ThreadPoolRunner.scala | 51 ---------------------- 4 files changed, 151 deletions(-) delete mode 100644 src/library/scala/concurrent/FutureTaskRunner.scala delete mode 100644 src/library/scala/concurrent/ManagedBlocker.scala delete mode 100644 src/library/scala/concurrent/TaskRunner.scala delete mode 100644 src/library/scala/concurrent/ThreadPoolRunner.scala (limited to 'src/library') diff --git a/src/library/scala/concurrent/FutureTaskRunner.scala b/src/library/scala/concurrent/FutureTaskRunner.scala deleted file mode 100644 index 089e67cedd..0000000000 --- a/src/library/scala/concurrent/FutureTaskRunner.scala +++ /dev/null @@ -1,39 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2009-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.concurrent - -import scala.language.{implicitConversions, higherKinds} - -/** The `FutureTaskRunner` trait is a base trait of task runners - * that provide some sort of future abstraction. - * - * @author Philipp Haller - */ -@deprecated("Use `ExecutionContext` instead.", "2.10.0") -private[scala] trait FutureTaskRunner extends TaskRunner { - - /** The type of the futures that the underlying task runner supports. - */ - type Future[T] - - /** An implicit conversion from futures to zero-parameter functions. - */ - implicit def futureAsFunction[S](x: Future[S]): () => S - - /** Submits a task to run which returns its result in a future. - */ - def submit[S](task: Task[S]): Future[S] - - /* Possibly blocks the current thread, for example, waiting for - * a lock or condition. - */ - @deprecated("Use `blocking` instead.", "2.10.0") - def managedBlock(blocker: ManagedBlocker): Unit - -} diff --git a/src/library/scala/concurrent/ManagedBlocker.scala b/src/library/scala/concurrent/ManagedBlocker.scala deleted file mode 100644 index b5a6e21893..0000000000 --- a/src/library/scala/concurrent/ManagedBlocker.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.concurrent - -/** The `ManagedBlocker` trait... - * - * @author Philipp Haller - */ -@deprecated("Use `blocking` instead.", "2.10.0") -private[scala] trait ManagedBlocker { - - /** - * Possibly blocks the current thread, for example waiting for - * a lock or condition. - * - * @return true if no additional blocking is necessary (i.e., - * if `isReleasable` would return `true`). - * @throws InterruptedException if interrupted while waiting - * (the method is not required to do so, but is allowed to). - */ - def block(): Boolean - - /** - * Returns `true` if blocking is unnecessary. - */ - def isReleasable: Boolean - -} diff --git a/src/library/scala/concurrent/TaskRunner.scala b/src/library/scala/concurrent/TaskRunner.scala deleted file mode 100644 index 1ea23b35e8..0000000000 --- a/src/library/scala/concurrent/TaskRunner.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.concurrent - -import scala.language.{higherKinds, implicitConversions} - -/** The `TaskRunner` trait... - * - * @author Philipp Haller - */ -@deprecated("Use `ExecutionContext` instead.", "2.10.0") -private[scala] trait TaskRunner { - - type Task[T] - - implicit def functionAsTask[S](fun: () => S): Task[S] - - def execute[S](task: Task[S]): Unit - - def shutdown(): Unit -} diff --git a/src/library/scala/concurrent/ThreadPoolRunner.scala b/src/library/scala/concurrent/ThreadPoolRunner.scala deleted file mode 100644 index 7784681f71..0000000000 --- a/src/library/scala/concurrent/ThreadPoolRunner.scala +++ /dev/null @@ -1,51 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala.concurrent - -import java.util.concurrent.{ExecutorService, Callable, TimeUnit} -import scala.language.implicitConversions - -/** The `ThreadPoolRunner` trait uses a `java.util.concurrent.ExecutorService` - * to run submitted tasks. - * - * @author Philipp Haller - */ -@deprecated("Use `ExecutionContext` instead.", "2.10.0") -private[scala] trait ThreadPoolRunner extends FutureTaskRunner { - - type Task[T] = Callable[T] with Runnable - type Future[T] = java.util.concurrent.Future[T] - - private class RunCallable[S](fun: () => S) extends Runnable with Callable[S] { - def run() = fun() - def call() = fun() - } - - implicit def functionAsTask[S](fun: () => S): Task[S] = - new RunCallable(fun) - - implicit def futureAsFunction[S](x: Future[S]): () => S = - () => x.get() - - protected def executor: ExecutorService - - def submit[S](task: Task[S]): Future[S] = { - executor.submit[S](task) - } - - def execute[S](task: Task[S]) { - executor execute task - } - - @deprecated("Use `blocking` instead.", "2.10.0") - def managedBlock(blocker: ManagedBlocker) { - blocker.block() - } - -} -- cgit v1.2.3