test: bunch of test cleanup from sendable_futures change
This commit is contained in:
parent
12439b0b24
commit
8e86cd0aa7
7 changed files with 19 additions and 12 deletions
|
|
@ -82,7 +82,7 @@ fn main(args: ~[~str]) {
|
|||
let num_chan2 = ~mut None;
|
||||
*num_chan2 <-> num_chan;
|
||||
let num_port = ~mut Some(num_port);
|
||||
futures += ~[future::spawn(|move num_chan2, move num_port| {
|
||||
let new_future = future::spawn(|move num_chan2, move num_port| {
|
||||
let mut num_chan = None;
|
||||
num_chan <-> *num_chan2;
|
||||
let mut num_port1 = None;
|
||||
|
|
@ -90,7 +90,8 @@ fn main(args: ~[~str]) {
|
|||
thread_ring(i, msg_per_task,
|
||||
option::unwrap(num_chan),
|
||||
option::unwrap(num_port1))
|
||||
})];
|
||||
});
|
||||
vec::push(futures, new_future);
|
||||
num_chan = Some(new_chan);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ fn main(args: ~[~str]) {
|
|||
let num_chan2 = ~mut None;
|
||||
*num_chan2 <-> num_chan;
|
||||
let num_port = ~mut Some(num_port);
|
||||
futures += ~[future::spawn(|move num_chan2, move num_port| {
|
||||
let new_future = do future::spawn
|
||||
|move num_chan2, move num_port| {
|
||||
let mut num_chan = None;
|
||||
num_chan <-> *num_chan2;
|
||||
let mut num_port1 = None;
|
||||
|
|
@ -86,7 +87,8 @@ fn main(args: ~[~str]) {
|
|||
thread_ring(i, msg_per_task,
|
||||
option::unwrap(num_chan),
|
||||
option::unwrap(num_port1))
|
||||
})];
|
||||
};
|
||||
vec::push(futures, new_future);
|
||||
num_chan = Some(new_chan);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ fn main(args: ~[~str]) {
|
|||
let num_chan2 = ~mut None;
|
||||
*num_chan2 <-> num_chan;
|
||||
let num_port = ~mut Some(num_port);
|
||||
futures += ~[future::spawn(|move num_chan2, move num_port| {
|
||||
let new_future = do future::spawn
|
||||
|move num_chan2, move num_port| {
|
||||
let mut num_chan = None;
|
||||
num_chan <-> *num_chan2;
|
||||
let mut num_port1 = None;
|
||||
|
|
@ -90,7 +91,8 @@ fn main(args: ~[~str]) {
|
|||
thread_ring(i, msg_per_task,
|
||||
option::unwrap(num_chan),
|
||||
option::unwrap(num_port1))
|
||||
})];
|
||||
};
|
||||
vec::push(futures, new_future);
|
||||
num_chan = Some(new_chan);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -45,11 +45,13 @@ fn main(args: ~[~str]) {
|
|||
let get_chan = Port();
|
||||
let get_chan_chan = Chan(get_chan);
|
||||
|
||||
futures += ~[do future::spawn |copy num_chan, move get_chan_chan| {
|
||||
let new_future = do future::spawn
|
||||
|copy num_chan, move get_chan_chan| {
|
||||
let p = Port();
|
||||
get_chan_chan.send(Chan(p));
|
||||
thread_ring(i, msg_per_task, num_chan, p)
|
||||
}];
|
||||
};
|
||||
vec::push(futures, new_future);
|
||||
|
||||
num_chan = get_chan.recv();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ fn stress(num_tasks: int) {
|
|||
let mut results = ~[];
|
||||
for range(0, num_tasks) |i| {
|
||||
do task::task().future_result(|+r| {
|
||||
results += ~[r];
|
||||
vec::push(results, r);
|
||||
}).spawn {
|
||||
stress_task(i);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ fn test00() {
|
|||
while i < number_of_tasks {
|
||||
let ch = po.chan();
|
||||
do task::task().future_result(|+r| {
|
||||
results += ~[r];
|
||||
vec::push(results, r);
|
||||
}).spawn |copy i| {
|
||||
test00_start(ch, i, number_of_messages)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ fn test00() {
|
|||
while i < number_of_tasks {
|
||||
i = i + 1;
|
||||
do task::task().future_result(|+r| {
|
||||
results += ~[r];
|
||||
vec::push(results, r);
|
||||
}).spawn |copy i| {
|
||||
test00_start(ch, i, number_of_messages);
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ fn test06() {
|
|||
while i < number_of_tasks {
|
||||
i = i + 1;
|
||||
do task::task().future_result(|+r| {
|
||||
results += ~[r];
|
||||
vec::push(results, r);
|
||||
}).spawn |copy i| {
|
||||
test06_start(i);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue