Skip to content

Commit 82523b7

Browse files
pcwaltonemberian
authored andcommitted
---
yaml --- r: 66395 b: refs/heads/master c: 1c0aa78 h: refs/heads/master i: 66393: 5612054 66391: bdbf6d6 v: v3
1 parent dce682f commit 82523b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+223
-223
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1eec3bba13fef50324d1a7542713b3189a627547
2+
refs/heads/master: 1c0aa7848103b5018473df851bc115d3e5585185
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libextra/arc.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ impl<'self> Condvar<'self> {
112112
pub struct ARC<T> { x: UnsafeAtomicRcBox<T> }
113113

114114
/// 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> {
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:Freeze+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:Freeze+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:Freeze + 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 }
149149
struct 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:Freeze + 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:Freeze + 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:Freeze + Owned>(
299299
RWARC { x: UnsafeAtomicRcBox::new(data), }
300300
}
301301

302-
impl<T:Freeze + 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:Freeze + Owned> RWARC<T> {
309309

310310
}
311311

312-
impl<T:Freeze + 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:Freeze + 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:Freeze + 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:Freeze + 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:Freeze + Owned> RWWriteMode<'self, T> {
493493
}
494494
}
495495

496-
impl<'self, T:Freeze + 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 {

trunk/src/libextra/comm.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct DuplexStream<T, U> {
3030
}
3131

3232
// Allow these methods to be used without import:
33-
impl<T:Owned,U:Owned> DuplexStream<T, U> {
33+
impl<T:Send,U:Send> DuplexStream<T, U> {
3434
pub fn send(&self, x: T) {
3535
self.chan.send(x)
3636
}
@@ -48,19 +48,19 @@ impl<T:Owned,U:Owned> DuplexStream<T, U> {
4848
}
4949
}
5050

51-
impl<T:Owned,U:Owned> GenericChan<T> for DuplexStream<T, U> {
51+
impl<T:Send,U:Send> GenericChan<T> for DuplexStream<T, U> {
5252
fn send(&self, x: T) {
5353
self.chan.send(x)
5454
}
5555
}
5656

57-
impl<T:Owned,U:Owned> GenericSmartChan<T> for DuplexStream<T, U> {
57+
impl<T:Send,U:Send> GenericSmartChan<T> for DuplexStream<T, U> {
5858
fn try_send(&self, x: T) -> bool {
5959
self.chan.try_send(x)
6060
}
6161
}
6262

63-
impl<T:Owned,U:Owned> GenericPort<U> for DuplexStream<T, U> {
63+
impl<T:Send,U:Send> GenericPort<U> for DuplexStream<T, U> {
6464
fn recv(&self) -> U {
6565
self.port.recv()
6666
}
@@ -70,20 +70,20 @@ impl<T:Owned,U:Owned> GenericPort<U> for DuplexStream<T, U> {
7070
}
7171
}
7272

73-
impl<T:Owned,U:Owned> Peekable<U> for DuplexStream<T, U> {
73+
impl<T:Send,U:Send> Peekable<U> for DuplexStream<T, U> {
7474
fn peek(&self) -> bool {
7575
self.port.peek()
7676
}
7777
}
7878

79-
impl<T:Owned,U:Owned> Selectable for DuplexStream<T, U> {
79+
impl<T:Send,U:Send> Selectable for DuplexStream<T, U> {
8080
fn header(&mut self) -> *mut pipes::PacketHeader {
8181
self.port.header()
8282
}
8383
}
8484

8585
/// Creates a bidirectional stream.
86-
pub fn DuplexStream<T:Owned,U:Owned>()
86+
pub fn DuplexStream<T:Send,U:Send>()
8787
-> (DuplexStream<T, U>, DuplexStream<U, T>)
8888
{
8989
let (p1, c2) = comm::stream();

trunk/src/libextra/flatpipes.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ Constructors for flat pipes that send POD types using memcpy.
166166
167167
# Safety Note
168168
169-
This module is currently unsafe because it uses `Copy Owned` as a type
170-
parameter bounds meaning POD (plain old data), but `Copy Owned` and
169+
This module is currently unsafe because it uses `Copy Send` as a type
170+
parameter bounds meaning POD (plain old data), but `Copy Send` and
171171
POD are not equivelant.
172172
173173
*/
@@ -191,7 +191,7 @@ pub mod pod {
191191
pub type PipeChan<T> = FlatChan<T, PodFlattener<T>, PipeByteChan>;
192192

193193
/// Create a `FlatPort` from a `Reader`
194-
pub fn reader_port<T:Copy + Owned,R:Reader>(
194+
pub fn reader_port<T:Copy + Send,R:Reader>(
195195
reader: R
196196
) -> ReaderPort<T, R> {
197197
let unflat: PodUnflattener<T> = PodUnflattener::new();
@@ -200,7 +200,7 @@ pub mod pod {
200200
}
201201

202202
/// Create a `FlatChan` from a `Writer`
203-
pub fn writer_chan<T:Copy + Owned,W:Writer>(
203+
pub fn writer_chan<T:Copy + Send,W:Writer>(
204204
writer: W
205205
) -> WriterChan<T, W> {
206206
let flat: PodFlattener<T> = PodFlattener::new();
@@ -209,21 +209,21 @@ pub mod pod {
209209
}
210210

211211
/// Create a `FlatPort` from a `Port<~[u8]>`
212-
pub fn pipe_port<T:Copy + Owned>(port: Port<~[u8]>) -> PipePort<T> {
212+
pub fn pipe_port<T:Copy + Send>(port: Port<~[u8]>) -> PipePort<T> {
213213
let unflat: PodUnflattener<T> = PodUnflattener::new();
214214
let byte_port = PipeBytePort::new(port);
215215
FlatPort::new(unflat, byte_port)
216216
}
217217

218218
/// Create a `FlatChan` from a `Chan<~[u8]>`
219-
pub fn pipe_chan<T:Copy + Owned>(chan: Chan<~[u8]>) -> PipeChan<T> {
219+
pub fn pipe_chan<T:Copy + Send>(chan: Chan<~[u8]>) -> PipeChan<T> {
220220
let flat: PodFlattener<T> = PodFlattener::new();
221221
let byte_chan = PipeByteChan::new(chan);
222222
FlatChan::new(flat, byte_chan)
223223
}
224224

225225
/// Create a pair of `FlatChan` and `FlatPort`, backed by pipes
226-
pub fn pipe_stream<T:Copy + Owned>() -> (PipePort<T>, PipeChan<T>) {
226+
pub fn pipe_stream<T:Copy + Send>() -> (PipePort<T>, PipeChan<T>) {
227227
let (port, chan) = comm::stream();
228228
return (pipe_port(port), pipe_chan(chan));
229229
}
@@ -352,7 +352,7 @@ pub mod flatteners {
352352
use core::sys::size_of;
353353
use core::vec;
354354

355-
// FIXME #4074: Copy + Owned != POD
355+
// FIXME #4074: Copy + Send != POD
356356
pub struct PodUnflattener<T> {
357357
bogus: ()
358358
}
@@ -361,7 +361,7 @@ pub mod flatteners {
361361
bogus: ()
362362
}
363363

364-
impl<T:Copy + Owned> Unflattener<T> for PodUnflattener<T> {
364+
impl<T:Copy + Send> Unflattener<T> for PodUnflattener<T> {
365365
fn unflatten(&self, buf: ~[u8]) -> T {
366366
assert!(size_of::<T>() != 0);
367367
assert_eq!(size_of::<T>(), buf.len());
@@ -371,7 +371,7 @@ pub mod flatteners {
371371
}
372372
}
373373

374-
impl<T:Copy + Owned> Flattener<T> for PodFlattener<T> {
374+
impl<T:Copy + Send> Flattener<T> for PodFlattener<T> {
375375
fn flatten(&self, val: T) -> ~[u8] {
376376
assert!(size_of::<T>() != 0);
377377
let val: *T = ptr::to_unsafe_ptr(&val);
@@ -380,15 +380,15 @@ pub mod flatteners {
380380
}
381381
}
382382

383-
impl<T:Copy + Owned> PodUnflattener<T> {
383+
impl<T:Copy + Send> PodUnflattener<T> {
384384
pub fn new() -> PodUnflattener<T> {
385385
PodUnflattener {
386386
bogus: ()
387387
}
388388
}
389389
}
390390

391-
impl<T:Copy + Owned> PodFlattener<T> {
391+
impl<T:Copy + Send> PodFlattener<T> {
392392
pub fn new() -> PodFlattener<T> {
393393
PodFlattener {
394394
bogus: ()

trunk/src/libextra/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub fn from_value<A>(val: A) -> Future<A> {
101101
Future {state: Forced(val)}
102102
}
103103

104-
pub fn from_port<A:Owned>(port: PortOne<A>) -> Future<A> {
104+
pub fn from_port<A:Send>(port: PortOne<A>) -> Future<A> {
105105
/*!
106106
* Create a future from a port
107107
*
@@ -127,7 +127,7 @@ pub fn from_fn<A>(f: ~fn() -> A) -> Future<A> {
127127
Future {state: Pending(f)}
128128
}
129129

130-
pub fn spawn<A:Owned>(blk: ~fn() -> A) -> Future<A> {
130+
pub fn spawn<A:Send>(blk: ~fn() -> A) -> Future<A> {
131131
/*!
132132
* Create a future from a unique closure.
133133
*

trunk/src/libextra/par.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static min_granularity : uint = 1024u;
3333
* This is used to build most of the other parallel vector functions,
3434
* like map or alli.
3535
*/
36-
fn map_slices<A:Copy + Owned,B:Copy + Owned>(
36+
fn map_slices<A:Copy + Send,B:Copy + Send>(
3737
xs: &[A],
3838
f: &fn() -> ~fn(uint, v: &[A]) -> B)
3939
-> ~[B] {
@@ -88,7 +88,7 @@ fn map_slices<A:Copy + Owned,B:Copy + Owned>(
8888
}
8989

9090
/// A parallel version of map.
91-
pub fn map<A:Copy + Owned,B:Copy + Owned>(
91+
pub fn map<A:Copy + Send,B:Copy + Send>(
9292
xs: &[A], fn_factory: &fn() -> ~fn(&A) -> B) -> ~[B] {
9393
vec::concat(map_slices(xs, || {
9494
let f = fn_factory();
@@ -99,7 +99,7 @@ pub fn map<A:Copy + Owned,B:Copy + Owned>(
9999
}
100100

101101
/// A parallel version of mapi.
102-
pub fn mapi<A:Copy + Owned,B:Copy + Owned>(
102+
pub fn mapi<A:Copy + Send,B:Copy + Send>(
103103
xs: &[A],
104104
fn_factory: &fn() -> ~fn(uint, &A) -> B) -> ~[B] {
105105
let slices = map_slices(xs, || {
@@ -118,7 +118,7 @@ pub fn mapi<A:Copy + Owned,B:Copy + Owned>(
118118
}
119119

120120
/// Returns true if the function holds for all elements in the vector.
121-
pub fn alli<A:Copy + Owned>(
121+
pub fn alli<A:Copy + Send>(
122122
xs: &[A],
123123
fn_factory: &fn() -> ~fn(uint, &A) -> bool) -> bool
124124
{
@@ -133,7 +133,7 @@ pub fn alli<A:Copy + Owned>(
133133
}
134134

135135
/// Returns true if the function holds for any elements in the vector.
136-
pub fn any<A:Copy + Owned>(
136+
pub fn any<A:Copy + Send>(
137137
xs: &[A],
138138
fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
139139
let mapped = map_slices(xs, || {

trunk/src/libextra/rc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
/** Task-local reference counted smart pointers
1414
1515
Task-local reference counted smart pointers are an alternative to managed boxes with deterministic
16-
destruction. They are restricted to containing types that are either `Owned` or `Freeze` (or both) to
16+
destruction. They are restricted to containing types that are either `Send` or `Freeze` (or both) to
1717
prevent cycles.
1818
19-
Neither `Rc<T>` or `RcMut<T>` is ever `Owned` and `RcMut<T>` is never `Freeze`. If `T` is `Freeze`, a
19+
Neither `Rc<T>` or `RcMut<T>` is ever `Send` and `RcMut<T>` is never `Freeze`. If `T` is `Freeze`, a
2020
cycle cannot be created with `Rc<T>` because there is no way to modify it after creation.
2121
2222
*/
@@ -51,7 +51,7 @@ impl<T> Rc<T> {
5151
}
5252

5353
// FIXME: #6516: should be a static method
54-
pub fn rc_from_owned<T: Owned>(value: T) -> Rc<T> {
54+
pub fn rc_from_owned<T: Send>(value: T) -> Rc<T> {
5555
unsafe { Rc::new(value) }
5656
}
5757

@@ -185,7 +185,7 @@ impl<T> RcMut<T> {
185185
}
186186

187187
// FIXME: #6516: should be a static method
188-
pub fn rc_mut_from_owned<T: Owned>(value: T) -> RcMut<T> {
188+
pub fn rc_mut_from_owned<T: Send>(value: T) -> RcMut<T> {
189189
unsafe { RcMut::new(value) }
190190
}
191191

0 commit comments

Comments
 (0)