let id = self.next_id.get();
self.next_id.set(id + 1);
Handle {
- id: id,
+ id,
selector: self.inner.get(),
next: ptr::null_mut(),
prev: ptr::null_mut(),
added: false,
- rx: rx,
+ rx,
packet: rx,
}
}
}
}
-#[stable(feature = "mpsc_debug", since = "1.7.0")]
impl fmt::Debug for Select {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Select {{ .. }}")
}
}
-#[stable(feature = "mpsc_debug", since = "1.7.0")]
impl<'rx, T:Send+'rx> fmt::Debug for Handle<'rx, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Handle {{ .. }}")
}
}
-#[cfg(test)]
#[allow(unused_imports)]
+#[cfg(all(test, not(target_os = "emscripten")))]
mod tests {
use thread;
use sync::mpsc::*;
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn unblocks() {
let (tx1, rx1) = channel::<i32>();
let (_tx2, rx2) = channel::<i32>();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn both_ready() {
let (tx1, rx1) = channel::<i32>();
let (tx2, rx2) = channel::<i32>();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn stress() {
const AMT: i32 = 10000;
let (tx1, rx1) = channel::<i32>();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn cloning() {
let (tx1, rx1) = channel::<i32>();
let (_tx2, rx2) = channel::<i32>();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn cloning2() {
let (tx1, rx1) = channel::<i32>();
let (_tx2, rx2) = channel::<i32>();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn cloning3() {
let (tx1, rx1) = channel::<()>();
let (tx2, rx2) = channel::<()>();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn oneshot_data_waiting() {
let (tx1, rx1) = channel();
let (tx2, rx2) = channel();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn stream_data_waiting() {
let (tx1, rx1) = channel();
let (tx2, rx2) = channel();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn shared_data_waiting() {
let (tx1, rx1) = channel();
let (tx2, rx2) = channel();
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn sync2() {
let (tx, rx) = sync_channel::<i32>(0);
let _t = thread::spawn(move|| {
}
#[test]
- #[cfg_attr(target_os = "emscripten", ignore)]
fn sync3() {
let (tx1, rx1) = sync_channel::<i32>(0);
let (tx2, rx2): (Sender<i32>, Receiver<i32>) = channel();