summaryrefslogtreecommitdiff
path: root/test/files/jvm/daemon-actor-termination.scala
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2009-05-27 15:59:21 +0000
committerPhilipp Haller <hallerp@gmail.com>2009-05-27 15:59:21 +0000
commitb22342e78a3134d186f82dac5e1c7be01ece7c17 (patch)
treed08e38c518de125e4e41021913fea3313b78964c /test/files/jvm/daemon-actor-termination.scala
parent29f58824a4afa0208ec45c57b1d999b132cfddf0 (diff)
downloadscala-b22342e78a3134d186f82dac5e1c7be01ece7c17.tar.gz
scala-b22342e78a3134d186f82dac5e1c7be01ece7c17.tar.bz2
scala-b22342e78a3134d186f82dac5e1c7be01ece7c17.zip
Added tests for #2015.
Diffstat (limited to 'test/files/jvm/daemon-actor-termination.scala')
-rw-r--r--test/files/jvm/daemon-actor-termination.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/jvm/daemon-actor-termination.scala b/test/files/jvm/daemon-actor-termination.scala
new file mode 100644
index 0000000000..322efbe212
--- /dev/null
+++ b/test/files/jvm/daemon-actor-termination.scala
@@ -0,0 +1,19 @@
+import scala.actors.DaemonActor
+
+/* Test that a DaemonActor that hasn't finished does not prevent termination */
+
+object Test {
+ class MyDaemon extends DaemonActor {
+ def act() {
+ println("I'm going to make you wait.")
+ Thread.sleep(5000)
+ println("Ok, I'm done.")
+ }
+ }
+ def main(args: Array[String]) {
+ val daemon = new MyDaemon
+ daemon.start()
+ Thread.sleep(500) // give the daemon a chance to start
+ println("I'm tired of waiting for you. Good bye.")
+ }
+}