@@ -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 : Const + 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 : Const + 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:Const+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 : Const + 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
@@ -282,14 +282,14 @@ struct RWARC<T> {
282
282
}
283
283
284
284
/// 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 > {
286
286
rw_arc_with_condvars ( user_data, 1 )
287
287
}
288
288
/**
289
289
* Create a reader/writer ARC with the supplied data and a specified number
290
290
* of condvars (as sync::rwlock_with_condvars).
291
291
*/
292
- pub fn rw_arc_with_condvars < T : Const + Owned > (
292
+ pub fn rw_arc_with_condvars < T : Freeze + Send > (
293
293
user_data : T ,
294
294
num_condvars : uint ) -> RWARC < T >
295
295
{
@@ -299,7 +299,7 @@ pub fn rw_arc_with_condvars<T:Const + Owned>(
299
299
RWARC { x : UnsafeAtomicRcBox :: new ( data) , }
300
300
}
301
301
302
- impl < T : Const + Owned > RWARC < T > {
302
+ impl < T : Freeze + Send > RWARC < T > {
303
303
/// Duplicate a rwlock-protected ARC, as arc::clone.
304
304
pub fn clone ( & self ) -> RWARC < T > {
305
305
RWARC {
@@ -309,7 +309,7 @@ impl<T:Const + Owned> RWARC<T> {
309
309
310
310
}
311
311
312
- impl < T : Const + Owned > RWARC < T > {
312
+ impl < T : Freeze + Send > RWARC < T > {
313
313
/**
314
314
* Access the underlying data mutably. Locks the rwlock in write mode;
315
315
* other readers and writers will block.
@@ -435,7 +435,7 @@ impl<T:Const + Owned> RWARC<T> {
435
435
// lock it. This wraps the unsafety, with the justification that the 'lock'
436
436
// field is never overwritten; only 'failed' and 'data'.
437
437
#[ 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 {
439
439
unsafe { cast:: transmute ( & const ( * state) . lock ) }
440
440
}
441
441
@@ -452,7 +452,7 @@ pub struct RWReadMode<'self, T> {
452
452
token : sync:: RWlockReadMode < ' self > ,
453
453
}
454
454
455
- impl < ' self , T : Const + Owned > RWWriteMode < ' self , T > {
455
+ impl < ' self , T : Freeze + Send > RWWriteMode < ' self , T > {
456
456
/// Access the pre-downgrade RWARC in write mode.
457
457
pub fn write < U > ( & mut self , blk : & fn ( x : & mut T ) -> U ) -> U {
458
458
match * self {
@@ -493,7 +493,7 @@ impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
493
493
}
494
494
}
495
495
496
- impl < ' self , T : Const + Owned > RWReadMode < ' self , T > {
496
+ impl < ' self , T : Freeze + Send > RWReadMode < ' self , T > {
497
497
/// Access the post-downgrade rwlock in read mode.
498
498
pub fn read < U > ( & self , blk : & fn ( x : & T ) -> U ) -> U {
499
499
match * self {
0 commit comments