2 #![allow(unused_must_use)]
3 // ignore-emscripten no threads support
5 #![feature(box_syntax)]
7 use std::sync::mpsc::{channel, Sender};
10 fn child(tx: &Sender<Box<usize>>, i: usize) {
11 tx.send(box i).unwrap();
15 let (tx, rx) = channel();
18 let ts = (0..n).map(|i| {
21 thread::spawn(move|| {
24 }).collect::<Vec<_>>();
28 let j = rx.recv().unwrap();
32 assert_eq!(expected, actual);
34 for t in ts { t.join(); }