Skip to content

Commit f0356d1

Browse files
committed
---
yaml --- r: 6747 b: refs/heads/master c: 4465c1a h: refs/heads/master i: 6745: df051e4 6743: 73d28bc v: v3
1 parent 343e1dc commit f0356d1

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 21cc0c6e69322a8ae3221d18bf8b3fbbdd5fd1f7
2+
refs/heads/master: 4465c1ad022740eb9204f3111396be6b16351632
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
use std;
2+
3+
import std::comm;
4+
import std::comm::chan;
5+
import std::comm::send;
6+
7+
fn main() { test05(); }
8+
9+
fn test05_start(&&f: sendfn(int)) {
10+
f(22);
11+
}
12+
13+
fn test05() {
14+
let three = ~3;
15+
let fn_to_send = sendfn(n: int) {
16+
log_err *three + n; // will copy x into the closure
17+
assert(*three == 3);
18+
};
19+
task::spawn(fn_to_send, test05_start);
20+
}

0 commit comments

Comments
 (0)