File tree Expand file tree Collapse file tree 4 files changed +21
-32
lines changed
branches/try/src/test/run-pass Expand file tree Collapse file tree 4 files changed +21
-32
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5
- refs/heads/try: 32901104cb54a37211ac1c05f377f69ee702485c
5
+ refs/heads/try: 76ec35ae743ee299484a48b233bc64cf3779097d
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- //xfail-test
12
-
13
11
extern mod std;
12
+ use core:: task:: spawn;
14
13
15
- fn f ( x : @ { a : int , b : int } ) {
16
- assert ! ( ( x . a == 10 ) ) ;
17
- assert ! ( ( x . b == 12 ) ) ;
14
+ struct Pair {
15
+ a : int ,
16
+ b : int
18
17
}
19
18
20
19
pub fn main ( ) {
21
- let z : @{ a : int , b : int } = @{ a : 10 , b : 12 } ;
22
- let p = task:: _spawn ( bind f( z) ) ;
23
- task:: join_id ( p) ;
20
+ let z = ~Pair { a : 10 , b : 12 } ;
21
+
22
+ let f: ~fn ( ) = || {
23
+ assert ! ( ( z. a == 10 ) ) ;
24
+ assert ! ( ( z. b == 12 ) ) ;
25
+ } ;
26
+
27
+ spawn ( f) ;
24
28
}
Original file line number Diff line number Diff line change 15
15
// xfail-test
16
16
17
17
extern mod std;
18
- use task:: join;
19
-
20
- fn loop ( n : int ) {
21
- let t1: task ;
22
- let t2: task ;
23
-
24
- if n > 0 { t1 = spawn loop( n - 1 ) ; t2 = spawn loop( n - 1 ) ; }
25
-
26
18
19
+ fn loopy ( n : int ) {
20
+ if n > 0 { do spawn { loopy( n - 1 ) } ; do spawn { loopy( n - 1 ) } ; }
27
21
loop { }
28
22
}
29
23
30
- pub fn main ( ) { let t: task = spawn loop( 5 ) ; join ( t) ; }
24
+ pub fn main ( ) {
25
+ // Commenting this out, as this will hang forever otherwise.
26
+ // Even after seeing the comment above, I'm not sure what the
27
+ // intention of this test is.
28
+ // do spawn { loopy(5) };
29
+ }
You can’t perform that action at this time.
0 commit comments