2 #![allow(unused_parens)]
3 // ignore-emscripten no threads support
5 use std::sync::mpsc::{channel, Sender};
9 let (tx, rx) = channel();
11 // Spawn 10 threads each sending us back one isize.
16 thread::spawn({let i = i; move|| { child(i, &tx) }});
20 // Spawned threads are likely killed before they get a chance to send
21 // anything back, so we deadlock here.
30 println!("main thread exiting");
33 fn child(x: isize, tx: &Sender<isize>) {