diff options
Diffstat (limited to 'test/files/jvm/actor-executor2.scala')
-rw-r--r-- | test/files/jvm/actor-executor2.scala | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala index f8fcaef69f..da64a7fc43 100644 --- a/test/files/jvm/actor-executor2.scala +++ b/test/files/jvm/actor-executor2.scala @@ -1,6 +1,6 @@ import scala.actors.{Actor, SchedulerAdapter, Exit} import Actor._ -import java.util.concurrent.{Executors, RejectedExecutionException} +import java.util.concurrent.Executors object One extends AdaptedActor { def act() { @@ -57,15 +57,9 @@ object Test { val scheduler = new SchedulerAdapter { def execute(block: => Unit) { - val task = new Runnable { + executor.execute(new Runnable { def run() { block } - } - try { - executor.execute(task) - } catch { - case ree: RejectedExecutionException => - task.run() // run task on current thread - } + }) } } |