@@ -112,15 +112,15 @@ impl<'self> Condvar<'self> {
112
112
pub struct ARC < T > { x : UnsafeAtomicRcBox < T > }
113
113
114
114
/// Create an atomically reference counted wrapper.
115
- pub fn ARC < T : Freeze + Owned > ( data : T ) -> ARC < T > {
115
+ pub fn ARC < T : Freeze + Send > ( data : T ) -> ARC < T > {
116
116
ARC { x : UnsafeAtomicRcBox :: new ( data) }
117
117
}
118
118
119
119
/**
120
120
* Access the underlying data in an atomically reference counted
121
121
* wrapper.
122
122
*/
123
- impl < T : Freeze +Owned > ARC < T > {
123
+ impl < T : Freeze +Send > ARC < T > {
124
124
pub fn get < ' a > ( & ' a self ) -> & ' a T {
125
125
unsafe { & * self . x . get_immut ( ) }
126
126
}
@@ -133,7 +133,7 @@ impl<T:Freeze+Owned> ARC<T> {
133
133
* object. However, one of the `arc` objects can be sent to another task,
134
134
* allowing them to share the underlying data.
135
135
*/
136
- impl < T : Freeze + Owned > Clone for ARC < T > {
136
+ impl < T : Freeze + Send > Clone for ARC < T > {
137
137
fn clone ( & self ) -> ARC < T > {
138
138
ARC { x : self . x . clone ( ) }
139
139
}
@@ -149,22 +149,22 @@ struct MutexARCInner<T> { lock: Mutex, failed: bool, data: T }
149
149
struct MutexARC < T > { x : UnsafeAtomicRcBox < MutexARCInner < T > > }
150
150
151
151
/// 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 > {
153
153
mutex_arc_with_condvars ( user_data, 1 )
154
154
}
155
155
/**
156
156
* Create a mutex-protected ARC with the supplied data and a specified number
157
157
* of condvars (as sync::mutex_with_condvars).
158
158
*/
159
- pub fn mutex_arc_with_condvars < T : Owned > ( user_data : T ,
159
+ pub fn mutex_arc_with_condvars < T : Send > ( user_data : T ,
160
160
num_condvars : uint ) -> MutexARC < T > {
161
161
let data =
162
162
MutexARCInner { lock : mutex_with_condvars ( num_condvars) ,
163
163
failed : false , data : user_data } ;
164
164
MutexARC { x : UnsafeAtomicRcBox :: new ( data) }
165
165
}
166
166
167
- impl < T : Owned > Clone for MutexARC < T > {
167
+ impl < T : Send > Clone for MutexARC < T > {
168
168
/// Duplicate a mutex-protected ARC, as arc::clone.
169
169
fn clone ( & self ) -> MutexARC < T > {
170
170
// NB: Cloning the underlying mutex is not necessary. Its reference
@@ -173,7 +173,7 @@ impl<T:Owned> Clone for MutexARC<T> {
173
173
}
174
174
}
175
175
176
- impl < T : Owned > MutexARC < T > {
176
+ impl < T : Send > MutexARC < T > {
177
177
178
178
/**
179
179
* Access the underlying mutable data with mutual exclusion from other
@@ -285,14 +285,14 @@ struct RWARC<T> {
285
285
}
286
286
287
287
/// Create a reader/writer ARC with the supplied data.
288
- pub fn RWARC < T : Freeze + Owned > ( user_data : T ) -> RWARC < T > {
288
+ pub fn RWARC < T : Freeze + Send > ( user_data : T ) -> RWARC < T > {
289
289
rw_arc_with_condvars ( user_data, 1 )
290
290
}
291
291
/**
292
292
* Create a reader/writer ARC with the supplied data and a specified number
293
293
* of condvars (as sync::rwlock_with_condvars).
294
294
*/
295
- pub fn rw_arc_with_condvars < T : Freeze + Owned > (
295
+ pub fn rw_arc_with_condvars < T : Freeze + Send > (
296
296
user_data : T ,
297
297
num_condvars : uint ) -> RWARC < T >
298
298
{
@@ -302,7 +302,7 @@ pub fn rw_arc_with_condvars<T:Freeze + Owned>(
302
302
RWARC { x : UnsafeAtomicRcBox :: new ( data) , cant_nest : ( ) }
303
303
}
304
304
305
- impl < T : Freeze + Owned > RWARC < T > {
305
+ impl < T : Freeze + Send > RWARC < T > {
306
306
/// Duplicate a rwlock-protected ARC, as arc::clone.
307
307
pub fn clone ( & self ) -> RWARC < T > {
308
308
RWARC {
@@ -313,7 +313,7 @@ impl<T:Freeze + Owned> RWARC<T> {
313
313
314
314
}
315
315
316
- impl < T : Freeze + Owned > RWARC < T > {
316
+ impl < T : Freeze + Send > RWARC < T > {
317
317
/**
318
318
* Access the underlying data mutably. Locks the rwlock in write mode;
319
319
* other readers and writers will block.
@@ -439,7 +439,7 @@ impl<T:Freeze + Owned> RWARC<T> {
439
439
// lock it. This wraps the unsafety, with the justification that the 'lock'
440
440
// field is never overwritten; only 'failed' and 'data'.
441
441
#[ doc( hidden) ]
442
- fn borrow_rwlock < T : Freeze + Owned > ( state : * const RWARCInner < T > ) -> * RWlock {
442
+ fn borrow_rwlock < T : Freeze + Send > ( state : * const RWARCInner < T > ) -> * RWlock {
443
443
unsafe { cast:: transmute ( & const ( * state) . lock ) }
444
444
}
445
445
@@ -456,7 +456,7 @@ pub struct RWReadMode<'self, T> {
456
456
token : sync:: RWlockReadMode < ' self > ,
457
457
}
458
458
459
- impl < ' self , T : Freeze + Owned > RWWriteMode < ' self , T > {
459
+ impl < ' self , T : Freeze + Send > RWWriteMode < ' self , T > {
460
460
/// Access the pre-downgrade RWARC in write mode.
461
461
pub fn write < U > ( & mut self , blk : & fn ( x : & mut T ) -> U ) -> U {
462
462
match * self {
@@ -497,7 +497,7 @@ impl<'self, T:Freeze + Owned> RWWriteMode<'self, T> {
497
497
}
498
498
}
499
499
500
- impl < ' self , T : Freeze + Owned > RWReadMode < ' self , T > {
500
+ impl < ' self , T : Freeze + Send > RWReadMode < ' self , T > {
501
501
/// Access the post-downgrade rwlock in read mode.
502
502
pub fn read < U > ( & self , blk : & fn ( x : & T ) -> U ) -> U {
503
503
match * self {
0 commit comments