blob: 42e0be4a8c8b3819510997395c29ef6a8da5f51b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
@deprecated("Suppress warnings", since="2.11")
object Test {
import scala.actors.Actor
/* This test is a regression test for SI-4759.
*/
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
}
}
}
}
}
|