diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-05-27 15:08:36 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-05-27 15:08:36 +0000 |
commit | 07eef107992887d539a23c4f34a4d6b8c6a4a8f7 (patch) | |
tree | 3850bf7918cd7c5425e51f34ec7421075e264329 /test/files/jvm/t1801.scala | |
parent | 76612dc8ec86a9c06f202be4c06c2d404f01195a (diff) | |
download | scala-07eef107992887d539a23c4f34a4d6b8c6a4a8f7.tar.gz scala-07eef107992887d539a23c4f34a4d6b8c6a4a8f7.tar.bz2 scala-07eef107992887d539a23c4f34a4d6b8c6a4a8f7.zip |
Added test case for #1801.
Diffstat (limited to 'test/files/jvm/t1801.scala')
-rw-r--r-- | test/files/jvm/t1801.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/jvm/t1801.scala b/test/files/jvm/t1801.scala new file mode 100644 index 0000000000..4b11732258 --- /dev/null +++ b/test/files/jvm/t1801.scala @@ -0,0 +1,31 @@ +import scala.actors.Actor._ + +object Test { + val rt = Runtime.getRuntime() + val sender = actor { + var cnt = 0 + while(cnt < 1000) { + if ((cnt % 100) == 0) println(cnt) + receiver ! new Array[Int] (1048576) + cnt += 1 + //println ("Used Mem: " + (((rt.totalMemory() - rt.freeMemory()) / 1048576.) formatted "%.2f") + " Mb") + } + receiver ! 'exit + } + + val receiver = actor { + loop { + react { + case x: Array[Int] => ()//println ("received " + x.length) + case 'exit => { + println("done!") + exit() + } + } + } + } + + def main (args: Array[String]) { + sender + } +} |