Skip to content

Commit 0e84b6b

Browse files
committed
---
yaml --- r: 38753 b: refs/heads/incoming c: 3e4b2bd h: refs/heads/master i: 38751: 311a76a v: v3
1 parent 7d35ee2 commit 0e84b6b

File tree

16 files changed

+22
-24
lines changed

16 files changed

+22
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: f6d2a7143629898aebea58db836eb2009e97d067
9+
refs/heads/incoming: 3e4b2bd2b2f48c98dab73c67b0ddf25a80129a3c
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/private.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ pub mod tests {
642642
// Have to get rid of our reference before blocking.
643643
{ let _x = move x; } // FIXME(#3161) util::ignore doesn't work here
644644
let res = option::swap_unwrap(&mut res);
645-
future::get(&res);
645+
res.recv();
646646
}
647647

648648
#[test] #[should_fail] #[ignore(cfg(windows))]
@@ -657,7 +657,7 @@ pub mod tests {
657657
}
658658
assert unwrap_exclusive(move x) == ~~"hello";
659659
let res = option::swap_unwrap(&mut res);
660-
future::get(&res);
660+
res.recv();
661661
}
662662

663663
#[test] #[ignore(cfg(windows))]

branches/incoming/src/libcore/task.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl TaskBuilder {
314314
* # Failure
315315
* Fails if a future_result was already set for this task.
316316
*/
317-
fn future_result(blk: fn(v: future::Future<TaskResult>)) -> TaskBuilder {
317+
fn future_result(blk: fn(v: Port<TaskResult>)) -> TaskBuilder {
318318
// FIXME (#3725): Once linked failure and notification are
319319
// handled in the library, I can imagine implementing this by just
320320
// registering an arbitrary number of task::on_exit handlers and
@@ -327,9 +327,7 @@ impl TaskBuilder {
327327
// Construct the future and give it to the caller.
328328
let (notify_pipe_ch, notify_pipe_po) = stream::<TaskResult>();
329329
330-
blk(do future::from_fn |move notify_pipe_po| {
331-
notify_pipe_po.recv()
332-
});
330+
blk(move notify_pipe_po);
333331
334332
// Reconfigure self to use a notify channel.
335333
TaskBuilder({
@@ -482,7 +480,7 @@ impl TaskBuilder {
482480
do fr_task_builder.spawn |move f| {
483481
comm::send(ch, f());
484482
}
485-
match future::get(&option::unwrap(move result)) {
483+
match option::unwrap(move result).recv() {
486484
Success => result::Ok(comm::recv(po)),
487485
Failure => result::Err(())
488486
}
@@ -899,14 +897,14 @@ fn test_add_wrapper() {
899897
fn test_future_result() {
900898
let mut result = None;
901899
do task().future_result(|+r| { result = Some(move r); }).spawn { }
902-
assert future::get(&option::unwrap(move result)) == Success;
900+
assert option::unwrap(move result).recv() == Success;
903901

904902
result = None;
905903
do task().future_result(|+r|
906904
{ result = Some(move r); }).unlinked().spawn {
907905
fail;
908906
}
909-
assert future::get(&option::unwrap(move result)) == Failure;
907+
assert option::unwrap(move result).recv() == Failure;
910908
}
911909

912910
#[test] #[should_fail] #[ignore(cfg(windows))]

branches/incoming/src/libstd/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ mod tests {
651651
}
652652

653653
// Wait for children to pass their asserts
654-
for vec::each(children) |r| { future::get(r); }
654+
for vec::each(children) |r| { r.recv(); }
655655

656656
// Wait for writer to finish
657657
p.recv();

branches/incoming/src/libstd/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn run_test(test: TestDesc, monitor_ch: comm::Chan<MonitorMsg>) {
391391
task::task().unlinked().future_result(|+r| {
392392
result_future = Some(move r);
393393
}).spawn(move testfn);
394-
let task_result = future::get(&option::unwrap(move result_future));
394+
let task_result = option::unwrap(move result_future).recv();
395395
let test_result = calc_result(&test, task_result == task::Success);
396396
comm::send(monitor_ch, (copy test, test_result));
397397
};

branches/incoming/src/test/bench/msgsend-pipes-shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn run(args: &[~str]) {
7474
}
7575

7676
for vec::each(worker_results) |r| {
77-
future::get(r);
77+
r.recv();
7878
}
7979

8080
//error!("sending stop message");

branches/incoming/src/test/bench/msgsend-pipes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn run(args: &[~str]) {
7171
}
7272

7373
for vec::each(worker_results) |r| {
74-
future::get(r);
74+
r.recv();
7575
}
7676

7777
//error!("sending stop message");

branches/incoming/src/test/bench/msgsend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn run(args: ~[~str]) {
4545
};
4646
}
4747
for vec::each(worker_results) |r| {
48-
future::get(r);
48+
r.recv();
4949
}
5050
comm::send(to_child, stop);
5151
let result = comm::recv(from_child);

branches/incoming/src/test/bench/shootout-pfib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn stress(num_tasks: int) {
7878
stress_task(i);
7979
}
8080
}
81-
for results.each |r| { future::get(r); }
81+
for results.each |r| { r.recv(); }
8282
}
8383

8484
fn main() {

branches/incoming/src/test/bench/task-perf-linked-failure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn spawn_supervised_blocking(myname: &str, +f: fn~()) {
3333
let mut res = None;
3434
task::task().future_result(|+r| res = Some(move r)).supervised().spawn(move f);
3535
error!("%s group waiting", myname);
36-
let x = future::get(&option::unwrap(move res));
36+
let x = option::unwrap(move res).recv();
3737
assert x == task::Success;
3838
}
3939

branches/incoming/src/test/run-pass/task-comm-12.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn test00() {
1919
}
2020

2121
// Try joining tasks that have already finished.
22-
future::get(&option::unwrap(move result));
22+
option::unwrap(move result).recv();
2323

2424
debug!("Joined task.");
2525
}

branches/incoming/src/test/run-pass/task-comm-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn test00() {
5353
}
5454

5555
// Join spawned tasks...
56-
for results.each |r| { future::get(r); }
56+
for results.each |r| { r.recv(); }
5757

5858
debug!("Completed: Final number is: ");
5959
log(error, sum);

branches/incoming/src/test/run-pass/task-comm-9.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn test00() {
3030
i += 1;
3131
}
3232

33-
future::get(&option::unwrap(move result));
33+
option::unwrap(move result).recv();
3434

3535
assert (sum == number_of_messages * (number_of_messages - 1) / 2);
3636
}

branches/incoming/src/test/run-pass/task-comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ fn test00() {
5151
while i < number_of_messages { sum += recv(po); i = i + 1; }
5252
}
5353

54-
for results.each |r| { future::get(r); }
54+
for results.each |r| { r.recv(); }
5555

5656
debug!("Completed: Final number is: ");
5757
assert (sum ==
@@ -134,7 +134,7 @@ fn test06() {
134134
}
135135

136136

137-
for results.each |r| { future::get(r); }
137+
for results.each |r| { r.recv(); }
138138
}
139139

140140

branches/incoming/src/test/run-pass/yield.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
error!("2");
1111
yield();
1212
error!("3");
13-
future::get(&option::unwrap(move result));
13+
option::unwrap(move result).recv();
1414
}
1515

1616
fn child() {

branches/incoming/src/test/run-pass/yield1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() {
77
task::task().future_result(|+r| { result = Some(move r); }).spawn(child);
88
error!("1");
99
yield();
10-
future::get(&option::unwrap(move result));
10+
option::unwrap(move result).recv();
1111
}
1212

1313
fn child() { error!("2"); }

0 commit comments

Comments
 (0)