diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-07-22 16:34:35 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-07-22 16:34:35 +0000 |
commit | 3307c3771777cf17d5b4d059726a1b484923d042 (patch) | |
tree | 90dd3a955d06bd439f69c34a464939a5470897c2 /test/files/jvm/actor-sync-send-timeout.scala | |
parent | f346e54d24847e0529ce1e5ee43e47a038a4961e (diff) | |
download | scala-3307c3771777cf17d5b4d059726a1b484923d042.tar.gz scala-3307c3771777cf17d5b4d059726a1b484923d042.tar.bz2 scala-3307c3771777cf17d5b4d059726a1b484923d042.zip |
Backport from trunk of a large batch of revisions:
24909,24919,24941,24961,24963,24965,24981,24984,24986,24987,24999,
25000,25001,25002,25003,25004,25005,25006,25007,25008,25009,25010,
25015,25028,25029,25030,25031,25033,25037,25038,25039,25040,25041,
25044,25045,25046,25050,25052,25053,25054,25055,25057,25058,25059,
25061,25062,25063,25065,25066,25069,25070,25071,25072,25074,25075,
25076,25080,25081,25082,25083,25085,25087,25088,25090,25091,25092,
25093,25094,25095,25096,25097,25098,25099,25100,25101,25110,25111,
25112,25113,25114,25117,25119,25122,25124,25125,25126,25127,25128,
25130,25132,25133,25134,25135,25136,25137,25138,25138,25139,25140,
25141,25142,25144,25145,25146,25148,25149,25152,25153,25158,25160,
25161,25162,25164,25167,25169,25170,25171,25172,25202,25204,25208,
25209,25252
Diffstat (limited to 'test/files/jvm/actor-sync-send-timeout.scala')
-rw-r--r-- | test/files/jvm/actor-sync-send-timeout.scala | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/files/jvm/actor-sync-send-timeout.scala b/test/files/jvm/actor-sync-send-timeout.scala new file mode 100644 index 0000000000..ed330900b2 --- /dev/null +++ b/test/files/jvm/actor-sync-send-timeout.scala @@ -0,0 +1,47 @@ +import scala.actors.Actor + +/* This test is a regression test for SI-4759. + */ +object Test { + val Runs = 5 + + def main(args: Array[String]) = { + var i = 0 + while (i < Runs) { + i += 1 + A1 ! 1 + Thread.sleep(500) + } + //println("done sending to A1") + } +} + +object A2 extends Actor { + this.start() + def act() { + loop { + react { + case 'stop => + //println("A2 exiting") + exit() + case _ => + } + } + } +} + +object A1 extends Actor { + this.start() + def act() { + var i = 0 + loopWhile(i < Test.Runs) { + i += 1 + react { + case any => + A2 !? (500, any) + if (i == Test.Runs) + A2 ! 'stop + } + } + } +} |