@@ -112,15 +112,15 @@ impl<'self> Condvar<'self> {
112112pub struct ARC < T > { x : UnsafeAtomicRcBox < T > }
113113
114114/// Create an atomically reference counted wrapper.
115- pub fn ARC < T : Const + Owned > ( data : T ) -> ARC < T > {
115+ pub fn ARC < T : Freeze + Send > ( data : T ) -> ARC < T > {
116116 ARC { x : UnsafeAtomicRcBox :: new ( data) }
117117}
118118
119119/**
120120 * Access the underlying data in an atomically reference counted
121121 * wrapper.
122122 */
123- impl < T : Const + Owned > ARC < T > {
123+ impl < T : Freeze + Send > ARC < T > {
124124 pub fn get < ' a > ( & ' a self ) -> & ' a T {
125125 unsafe { & * self . x . get_immut ( ) }
126126 }
@@ -133,7 +133,7 @@ impl<T:Const+Owned> ARC<T> {
133133 * object. However, one of the `arc` objects can be sent to another task,
134134 * allowing them to share the underlying data.
135135 */
136- impl < T : Const + Owned > Clone for ARC < T > {
136+ impl < T : Freeze + Send > Clone for ARC < T > {
137137 fn clone ( & self ) -> ARC < T > {
138138 ARC { x : self . x . clone ( ) }
139139 }
@@ -149,22 +149,22 @@ struct MutexARCInner<T> { lock: Mutex, failed: bool, data: T }
149149struct MutexARC < T > { x : UnsafeAtomicRcBox < MutexARCInner < T > > }
150150
151151/// Create a mutex-protected ARC with the supplied data.
152- pub fn MutexARC < T : Owned > ( user_data : T ) -> MutexARC < T > {
152+ pub fn MutexARC < T : Send > ( user_data : T ) -> MutexARC < T > {
153153 mutex_arc_with_condvars ( user_data, 1 )
154154}
155155/**
156156 * Create a mutex-protected ARC with the supplied data and a specified number
157157 * of condvars (as sync::mutex_with_condvars).
158158 */
159- pub fn mutex_arc_with_condvars < T : Owned > ( user_data : T ,
159+ pub fn mutex_arc_with_condvars < T : Send > ( user_data : T ,
160160 num_condvars : uint ) -> MutexARC < T > {
161161 let data =
162162 MutexARCInner { lock : mutex_with_condvars ( num_condvars) ,
163163 failed : false , data : user_data } ;
164164 MutexARC { x : UnsafeAtomicRcBox :: new ( data) }
165165}
166166
167- impl < T : Owned > Clone for MutexARC < T > {
167+ impl < T : Send > Clone for MutexARC < T > {
168168 /// Duplicate a mutex-protected ARC, as arc::clone.
169169 fn clone ( & self ) -> MutexARC < T > {
170170 // NB: Cloning the underlying mutex is not necessary. Its reference
@@ -173,7 +173,7 @@ impl<T:Owned> Clone for MutexARC<T> {
173173 }
174174}
175175
176- impl < T : Owned > MutexARC < T > {
176+ impl < T : Send > MutexARC < T > {
177177
178178 /**
179179 * Access the underlying mutable data with mutual exclusion from other
@@ -282,14 +282,14 @@ struct RWARC<T> {
282282}
283283
284284/// Create a reader/writer ARC with the supplied data.
285- pub fn RWARC < T : Const + Owned > ( user_data : T ) -> RWARC < T > {
285+ pub fn RWARC < T : Freeze + Send > ( user_data : T ) -> RWARC < T > {
286286 rw_arc_with_condvars ( user_data, 1 )
287287}
288288/**
289289 * Create a reader/writer ARC with the supplied data and a specified number
290290 * of condvars (as sync::rwlock_with_condvars).
291291 */
292- pub fn rw_arc_with_condvars < T : Const + Owned > (
292+ pub fn rw_arc_with_condvars < T : Freeze + Send > (
293293 user_data : T ,
294294 num_condvars : uint ) -> RWARC < T >
295295{
@@ -299,7 +299,7 @@ pub fn rw_arc_with_condvars<T:Const + Owned>(
299299 RWARC { x : UnsafeAtomicRcBox :: new ( data) , }
300300}
301301
302- impl < T : Const + Owned > RWARC < T > {
302+ impl < T : Freeze + Send > RWARC < T > {
303303 /// Duplicate a rwlock-protected ARC, as arc::clone.
304304 pub fn clone ( & self ) -> RWARC < T > {
305305 RWARC {
@@ -309,7 +309,7 @@ impl<T:Const + Owned> RWARC<T> {
309309
310310}
311311
312- impl < T : Const + Owned > RWARC < T > {
312+ impl < T : Freeze + Send > RWARC < T > {
313313 /**
314314 * Access the underlying data mutably. Locks the rwlock in write mode;
315315 * other readers and writers will block.
@@ -435,7 +435,7 @@ impl<T:Const + Owned> RWARC<T> {
435435// lock it. This wraps the unsafety, with the justification that the 'lock'
436436// field is never overwritten; only 'failed' and 'data'.
437437#[ doc( hidden) ]
438- fn borrow_rwlock < T : Const + Owned > ( state : * const RWARCInner < T > ) -> * RWlock {
438+ fn borrow_rwlock < T : Freeze + Send > ( state : * const RWARCInner < T > ) -> * RWlock {
439439 unsafe { cast:: transmute ( & const ( * state) . lock ) }
440440}
441441
@@ -452,7 +452,7 @@ pub struct RWReadMode<'self, T> {
452452 token : sync:: RWlockReadMode < ' self > ,
453453}
454454
455- impl < ' self , T : Const + Owned > RWWriteMode < ' self , T > {
455+ impl < ' self , T : Freeze + Send > RWWriteMode < ' self , T > {
456456 /// Access the pre-downgrade RWARC in write mode.
457457 pub fn write < U > ( & mut self , blk : & fn ( x : & mut T ) -> U ) -> U {
458458 match * self {
@@ -493,7 +493,7 @@ impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
493493 }
494494}
495495
496- impl < ' self , T : Const + Owned > RWReadMode < ' self , T > {
496+ impl < ' self , T : Freeze + Send > RWReadMode < ' self , T > {
497497 /// Access the post-downgrade rwlock in read mode.
498498 pub fn read < U > ( & self , blk : & fn ( x : & T ) -> U ) -> U {
499499 match * self {
0 commit comments