@@ -78,7 +78,7 @@ pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
7878 }
7979}
8080
81- impl < T > ChanOne < T > {
81+ impl < T : Send > ChanOne < T > {
8282 #[ inline]
8383 fn packet ( & self ) -> * mut Packet < T > {
8484 unsafe {
@@ -181,7 +181,7 @@ impl<T> ChanOne<T> {
181181 }
182182}
183183
184- impl < T > PortOne < T > {
184+ impl < T : Send > PortOne < T > {
185185 fn packet ( & self ) -> * mut Packet < T > {
186186 unsafe {
187187 let p: * mut ~Packet < T > = cast:: transmute ( & self . void_packet ) ;
@@ -218,7 +218,7 @@ impl<T> PortOne<T> {
218218 }
219219}
220220
221- impl < T > SelectInner for PortOne < T > {
221+ impl < T : Send > SelectInner for PortOne < T > {
222222 #[ inline] #[ cfg( not( test) ) ]
223223 fn optimistic_check ( & mut self ) -> bool {
224224 unsafe { ( * self . packet ( ) ) . state . load ( Acquire ) == STATE_ONE }
@@ -319,9 +319,9 @@ impl<T> SelectInner for PortOne<T> {
319319 }
320320}
321321
322- impl < T > Select for PortOne < T > { }
322+ impl < T : Send > Select for PortOne < T > { }
323323
324- impl < T > SelectPortInner < T > for PortOne < T > {
324+ impl < T : Send > SelectPortInner < T > for PortOne < T > {
325325 fn recv_ready ( mut self ) -> Option < T > {
326326 let packet = self . packet ( ) ;
327327
@@ -352,9 +352,9 @@ impl<T> SelectPortInner<T> for PortOne<T> {
352352 }
353353}
354354
355- impl < T > SelectPort < T > for PortOne < T > { }
355+ impl < T : Send > SelectPort < T > for PortOne < T > { }
356356
357- impl < T > Peekable < T > for PortOne < T > {
357+ impl < T : Send > Peekable < T > for PortOne < T > {
358358 fn peek ( & self ) -> bool {
359359 unsafe {
360360 let packet: * mut Packet < T > = self . packet ( ) ;
@@ -369,7 +369,7 @@ impl<T> Peekable<T> for PortOne<T> {
369369}
370370
371371#[ unsafe_destructor]
372- impl < T > Drop for ChanOne < T > {
372+ impl < T : Send > Drop for ChanOne < T > {
373373 fn drop ( & mut self ) {
374374 if self . suppress_finalize { return }
375375
@@ -396,7 +396,7 @@ impl<T> Drop for ChanOne<T> {
396396}
397397
398398#[ unsafe_destructor]
399- impl < T > Drop for PortOne < T > {
399+ impl < T : Send > Drop for PortOne < T > {
400400 fn drop ( & mut self ) {
401401 if self . suppress_finalize { return }
402402
@@ -484,7 +484,7 @@ impl<T: Send> SendDeferred<T> for Chan<T> {
484484 }
485485}
486486
487- impl < T > GenericPort < T > for Port < T > {
487+ impl < T : Send > GenericPort < T > for Port < T > {
488488 fn recv ( & self ) -> T {
489489 match self . try_recv ( ) {
490490 Some ( val) => val,
@@ -507,7 +507,7 @@ impl<T> GenericPort<T> for Port<T> {
507507 }
508508}
509509
510- impl < T > Peekable < T > for Port < T > {
510+ impl < T : Send > Peekable < T > for Port < T > {
511511 fn peek ( & self ) -> bool {
512512 self . next . with_mut_ref ( |p| p. peek ( ) )
513513 }
@@ -517,7 +517,7 @@ impl<T> Peekable<T> for Port<T> {
517517// of them, but a &Port<T> should also be selectable so you can select2 on it
518518// alongside a PortOne<U> without passing the port by value in recv_ready.
519519
520- impl < ' self , T > SelectInner for & ' self Port < T > {
520+ impl < ' self , T : Send > SelectInner for & ' self Port < T > {
521521 #[ inline]
522522 fn optimistic_check ( & mut self ) -> bool {
523523 do self . next . with_mut_ref |pone| { pone. optimistic_check ( ) }
@@ -535,9 +535,9 @@ impl<'self, T> SelectInner for &'self Port<T> {
535535 }
536536}
537537
538- impl < ' self , T > Select for & ' self Port < T > { }
538+ impl < ' self , T : Send > Select for & ' self Port < T > { }
539539
540- impl < T > SelectInner for Port < T > {
540+ impl < T : Send > SelectInner for Port < T > {
541541 #[ inline]
542542 fn optimistic_check ( & mut self ) -> bool {
543543 ( & * self ) . optimistic_check ( )
@@ -554,9 +554,9 @@ impl<T> SelectInner for Port<T> {
554554 }
555555}
556556
557- impl < T > Select for Port < T > { }
557+ impl < T : Send > Select for Port < T > { }
558558
559- impl < ' self , T > SelectPortInner < T > for & ' self Port < T > {
559+ impl < ' self , T : Send > SelectPortInner < T > for & ' self Port < T > {
560560 fn recv_ready ( self ) -> Option < T > {
561561 match self . next . take ( ) . recv_ready ( ) {
562562 Some ( StreamPayload { val, next } ) => {
@@ -568,14 +568,14 @@ impl<'self, T> SelectPortInner<T> for &'self Port<T> {
568568 }
569569}
570570
571- impl < ' self , T > SelectPort < T > for & ' self Port < T > { }
571+ impl < ' self , T : Send > SelectPort < T > for & ' self Port < T > { }
572572
573573pub struct SharedChan < T > {
574574 // Just like Chan, but a shared AtomicOption instead of Cell
575575 priv next : UnsafeArc < AtomicOption < StreamChanOne < T > > >
576576}
577577
578- impl < T > SharedChan < T > {
578+ impl < T : Send > SharedChan < T > {
579579 pub fn new ( chan : Chan < T > ) -> SharedChan < T > {
580580 let next = chan. next . take ( ) ;
581581 let next = AtomicOption :: new ( ~next) ;
@@ -615,7 +615,7 @@ impl<T: Send> SendDeferred<T> for SharedChan<T> {
615615 }
616616}
617617
618- impl < T > Clone for SharedChan < T > {
618+ impl < T : Send > Clone for SharedChan < T > {
619619 fn clone ( & self ) -> SharedChan < T > {
620620 SharedChan {
621621 next : self . next . clone ( )
@@ -628,7 +628,7 @@ pub struct SharedPort<T> {
628628 priv next_link : UnsafeArc < AtomicOption < PortOne < StreamPortOne < T > > > >
629629}
630630
631- impl < T > SharedPort < T > {
631+ impl < T : Send > SharedPort < T > {
632632 pub fn new ( port : Port < T > ) -> SharedPort < T > {
633633 // Put the data port into a new link pipe
634634 let next_data_port = port. next . take ( ) ;
@@ -670,7 +670,7 @@ impl<T: Send> GenericPort<T> for SharedPort<T> {
670670 }
671671}
672672
673- impl < T > Clone for SharedPort < T > {
673+ impl < T : Send > Clone for SharedPort < T > {
674674 fn clone ( & self ) -> SharedPort < T > {
675675 SharedPort {
676676 next_link : self . next_link . clone ( )
0 commit comments