File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -597,7 +597,6 @@ mod tests {
597597
598598 use arc:: * ;
599599
600- use std:: cell:: Cell ;
601600 use std:: comm;
602601 use std:: task;
603602
@@ -628,7 +627,6 @@ mod tests {
628627 let arc = ~MutexArc :: new ( false ) ;
629628 let arc2 = ~arc. clone ( ) ;
630629 let ( p, c) = comm:: oneshot ( ) ;
631- let c = Cell :: new ( c) ;
632630 do task:: spawn {
633631 // wait until parent gets in
634632 p. recv ( ) ;
@@ -638,8 +636,9 @@ mod tests {
638636 } )
639637 }
640638
639+ let mut c = Some ( c) ;
641640 arc. access_cond ( |state, cond| {
642- c. take ( ) . send ( ( ) ) ;
641+ c. take_unwrap ( ) . send ( ( ) ) ;
643642 assert ! ( !* state) ;
644643 while !* state {
645644 cond. wait ( ) ;
Original file line number Diff line number Diff line change @@ -676,7 +676,6 @@ mod tests {
676676 use sync:: * ;
677677
678678 use std:: cast;
679- use std:: cell:: Cell ;
680679 use std:: comm;
681680 use std:: result;
682681 use std:: task;
@@ -762,9 +761,9 @@ mod tests {
762761 let s = Semaphore :: new ( 1 ) ;
763762 let s2 = s. clone ( ) ;
764763 let ( p, c) = comm:: stream ( ) ;
765- let child_data = Cell :: new ( ( s2, c) ) ;
764+ let mut child_data = Some ( ( s2, c) ) ;
766765 s. access ( || {
767- let ( s2, c) = child_data. take ( ) ;
766+ let ( s2, c) = child_data. take_unwrap ( ) ;
768767 do task:: spawn {
769768 c. send ( ( ) ) ;
770769 s2. access ( || { } ) ;
@@ -947,13 +946,13 @@ mod tests {
947946 let mut sibling_convos = ~[ ] ;
948947 2 . times ( || {
949948 let ( p, c) = comm:: stream ( ) ;
950- let c = Cell :: new ( c) ;
951949 sibling_convos. push ( p) ;
952950 let mi = m2. clone ( ) ;
953951 // spawn sibling task
954952 do task:: spawn { // linked
953+ let mut c = Some ( c) ;
955954 mi. lock_cond ( |cond| {
956- let c = c. take ( ) ;
955+ let c = c. take_unwrap ( ) ;
957956 c. send ( ( ) ) ; // tell sibling to go ahead
958957 ( || {
959958 cond. wait ( ) ; // block forever
You can’t perform that action at this time.
0 commit comments