inner: UnsafeCell<Flavor<T>>,
receives: Cell<uint>,
// can't share in an arc
- marker: marker::NoSync,
+ _marker: marker::NoSync,
}
/// An iterator over messages on a receiver, this iterator will block
/// whenever `next` is called, waiting for a new message, and `None` will be
/// returned when the corresponding channel has hung up.
#[unstable]
-#[cfg(not(stage0))]
pub struct Messages<'a, T:'a> {
rx: &'a Receiver<T>
}
-/// Stage0 only
-#[cfg(stage0)]
-#[unstable]
-pub struct Messages<'a, T> {
- rx: &'a Receiver<T>
-}
-
/// The sending-half of Rust's asynchronous channel type. This half can only be
/// owned by one task, but it can be cloned to send to other tasks.
#[unstable]
inner: UnsafeCell<Flavor<T>>,
sends: Cell<uint>,
// can't share in an arc
- marker: marker::NoSync,
+ _marker: marker::NoSync,
}
/// The sending-half of Rust's synchronous channel type. This half can only be
pub struct SyncSender<T> {
inner: Arc<UnsafeCell<sync::Packet<T>>>,
// can't share in an arc
- marker: marker::NoSync,
+ _marker: marker::NoSync,
}
/// This enumeration is the list of the possible reasons that try_recv could not
#[doc(hidden)]
trait UnsafeFlavor<T> {
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>>;
- unsafe fn mut_inner<'a>(&'a self) -> &'a mut Flavor<T> {
+ unsafe fn inner_mut<'a>(&'a self) -> &'a mut Flavor<T> {
&mut *self.inner_unsafe().get()
}
unsafe fn inner<'a>(&'a self) -> &'a Flavor<T> {
Sender {
inner: UnsafeCell::new(inner),
sends: Cell::new(0),
- marker: marker::NoSync,
+ _marker: marker::NoSync,
}
}
unsafe {
let tmp = Sender::new(Stream(new_inner));
- mem::swap(self.mut_inner(), tmp.mut_inner());
+ mem::swap(self.inner_mut(), tmp.inner_mut());
}
return ret;
}
(*packet.get()).inherit_blocker(sleeper);
let tmp = Sender::new(Shared(packet.clone()));
- mem::swap(self.mut_inner(), tmp.mut_inner());
+ mem::swap(self.inner_mut(), tmp.inner_mut());
}
Sender::new(Shared(packet))
}
#[unsafe_destructor]
impl<T: Send> Drop for Sender<T> {
fn drop(&mut self) {
- match *unsafe { self.mut_inner() } {
+ match *unsafe { self.inner_mut() } {
Oneshot(ref mut p) => unsafe { (*p.get()).drop_chan(); },
Stream(ref mut p) => unsafe { (*p.get()).drop_chan(); },
Shared(ref mut p) => unsafe { (*p.get()).drop_chan(); },
impl<T: Send> SyncSender<T> {
fn new(inner: Arc<UnsafeCell<sync::Packet<T>>>) -> SyncSender<T> {
- SyncSender { inner: inner, marker: marker::NoSync }
+ SyncSender { inner: inner, _marker: marker::NoSync }
}
/// Sends a value on this synchronous channel.
impl<T: Send> Receiver<T> {
fn new(inner: Flavor<T>) -> Receiver<T> {
- Receiver { inner: UnsafeCell::new(inner), receives: Cell::new(0), marker: marker::NoSync }
+ Receiver { inner: UnsafeCell::new(inner), receives: Cell::new(0), _marker: marker::NoSync }
}
/// Blocks waiting for a value on this receiver
}
};
unsafe {
- mem::swap(self.mut_inner(),
- new_port.mut_inner());
+ mem::swap(self.inner_mut(),
+ new_port.inner_mut());
}
}
}
Sync(ref p) => return unsafe { (*p.get()).recv() }
};
unsafe {
- mem::swap(self.mut_inner(), new_port.mut_inner());
+ mem::swap(self.inner_mut(), new_port.inner_mut());
}
}
}
}
};
unsafe {
- mem::swap(self.mut_inner(),
- new_port.mut_inner());
+ mem::swap(self.inner_mut(),
+ new_port.inner_mut());
}
}
}
};
task = t;
unsafe {
- mem::swap(self.mut_inner(),
- new_port.mut_inner());
+ mem::swap(self.inner_mut(),
+ new_port.inner_mut());
}
}
}
let new_port = match result { Ok(b) => return b, Err(p) => p };
was_upgrade = true;
unsafe {
- mem::swap(self.mut_inner(),
- new_port.mut_inner());
+ mem::swap(self.inner_mut(),
+ new_port.inner_mut());
}
}
}
#[unsafe_destructor]
impl<T: Send> Drop for Receiver<T> {
fn drop(&mut self) {
- match *unsafe { self.mut_inner() } {
+ match *unsafe { self.inner_mut() } {
Oneshot(ref mut p) => unsafe { (*p.get()).drop_port(); },
Stream(ref mut p) => unsafe { (*p.get()).drop_port(); },
Shared(ref mut p) => unsafe { (*p.get()).drop_port(); },