2011-10-10 20:19:01 -05:00
|
|
|
// This is what the signature to spawn should look like with bare functions
|
|
|
|
|
2012-09-07 16:52:28 -05:00
|
|
|
fn spawn<T: Send>(val: T, f: extern fn(T)) {
|
2012-09-19 00:45:24 -05:00
|
|
|
f(move val);
|
2011-10-10 20:19:01 -05:00
|
|
|
}
|
|
|
|
|
2012-09-19 15:59:44 -05:00
|
|
|
fn f(+i: int) {
|
2011-10-10 20:19:01 -05:00
|
|
|
assert i == 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
spawn(100, f);
|
2012-09-18 17:52:21 -05:00
|
|
|
}
|