2 #![allow(unused_variables)]
3 // ignore-emscripten no threads support
5 use std::sync::mpsc::{channel, Sender};
8 fn start(tx: &Sender<isize>, start: isize, number_of_messages: isize) {
10 while i< number_of_messages { tx.send(start + i).unwrap(); i += 1; }
14 println!("Check that we don't deadlock.");
15 let (tx, rx) = channel();
16 let _ = thread::spawn(move|| { start(&tx, 0, 10) }).join();
17 println!("Joined task");