@@ -24,26 +24,26 @@ proto! ring (
2424fn macros( ) {
2525 #macro[
2626 [ #move_out[ x] ,
27- unsafe { let y <- * ptr:: addr_of ( & x ) ; y } ]
27+ unsafe { let y <- * ptr:: addr_of ( & x ) ; move y } ]
2828 ] ;
2929}
3030
3131fn thread_ring( i : uint ,
3232 count : uint ,
3333 +num_chan : ring:: client:: num ,
3434 +num_port : ring:: server:: num ) {
35- let mut num_chan <- Some ( num_chan ) ;
36- let mut num_port <- Some ( num_port ) ;
35+ let mut num_chan <- Some ( move num_chan ) ;
36+ let mut num_port <- Some ( move num_port ) ;
3737 // Send/Receive lots of messages.
38- for uint:: range ( 0 u , count ) |j| {
38+ for uint:: range ( 0 , count ) |j| {
3939 //error!("task %?, iter %?", i, j);
4040 let mut num_chan2 = None ;
4141 let mut num_port2 = None ;
4242 num_chan2 <-> num_chan;
4343 num_port2 <-> num_port;
44- num_chan = Some ( ring:: client:: num ( option:: unwrap ( num_chan2) , i * j) ) ;
45- let port = option:: unwrap ( num_port2) ;
46- match recv ( port) {
44+ num_chan = Some ( ring:: client:: num ( option:: unwrap ( move num_chan2) , i * j) ) ;
45+ let port = option:: unwrap ( move num_port2) ;
46+ match recv ( move port) {
4747 ring:: num( _n, p) => {
4848 //log(error, _n);
4949 num_port = Some ( move_out ! ( p) ) ;
@@ -66,7 +66,7 @@ fn main() {
6666 let msg_per_task = uint:: from_str ( args[ 2 ] ) . get ( ) ;
6767
6868 let ( num_chan, num_port) = ring:: init ( ) ;
69- let mut num_chan = Some ( num_chan) ;
69+ let mut num_chan = Some ( move num_chan) ;
7070
7171 let start = time:: precise_time_s ( ) ;
7272
@@ -78,23 +78,23 @@ fn main() {
7878 let ( new_chan, num_port) = ring:: init ( ) ;
7979 let num_chan2 = ~mut None ;
8080 * num_chan2 <-> num_chan;
81- let num_port = ~mut Some ( num_port) ;
81+ let num_port = ~mut Some ( move num_port) ;
8282 let new_future = do future:: spawn
8383 |move num_chan2, move num_port| {
8484 let mut num_chan = None ;
8585 num_chan <-> * num_chan2;
8686 let mut num_port1 = None ;
8787 num_port1 <-> * num_port;
8888 thread_ring ( i, msg_per_task,
89- option:: unwrap ( num_chan) ,
90- option:: unwrap ( num_port1) )
89+ option:: unwrap ( move num_chan) ,
90+ option:: unwrap ( move num_port1) )
9191 } ;
92- futures. push ( new_future) ;
93- num_chan = Some ( new_chan) ;
92+ futures. push ( move new_future) ;
93+ num_chan = Some ( move new_chan) ;
9494 } ;
9595
9696 // do our iteration
97- thread_ring ( 0 u , msg_per_task, option:: unwrap ( num_chan) , num_port) ;
97+ thread_ring ( 0 , msg_per_task, option:: unwrap ( move num_chan) , move num_port) ;
9898
9999 // synchronize
100100 for futures. each |f| { future:: get( f) } ;
0 commit comments