blob: 4a6bf92d4851a36c6a7d39ffa87448e8c3744fcb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/* Test that an actor that hasn't finished prevents termination */
@deprecated("Suppress warnings", since="2.11")
object Test {
import scala.actors.Actor
def main(args: Array[String]) {
Actor.actor {
try {
println("I'm going to make you wait.")
Thread.sleep(5000)
println("Ok, I'm done.")
} catch {
case e: Throwable if !e.isInstanceOf[scala.util.control.ControlThrowable] =>
e.printStackTrace()
}
}
}
}
|