From f500f3f1fb4092bf7993170d755377268943e94b Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 22 Oct 2012 19:16:52 -0700 Subject: [PATCH] core: Remove remaining use of Future --- src/libcore/private.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libcore/private.rs b/src/libcore/private.rs index e7e9de39ccdb..a65e0ae1bb12 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -581,16 +581,20 @@ pub mod tests { for uint::range(0, num_tasks) |_i| { let total = total.clone(); - futures.push(future::spawn(|move total| { + let (chan, port) = pipes::stream(); + futures.push(move port); + + do task::spawn |move total, move chan| { for uint::range(0, count) |_i| { do total.with |count| { **count += 1; } } - })); + chan.send(()); + } }; - for futures.each |f| { f.get() } + for futures.each |f| { f.recv() } do total.with |total| { assert **total == num_tasks * count