1 // program should terminate even if a thread is blocked on I/O.
2 // https://github.com/fortanix/rust-sgx/issues/109
5 // ignore-emscripten no threads support
7 use std::{net::TcpListener, sync::mpsc, thread};
10 let (tx, rx) = mpsc::channel();
11 thread::spawn(move || {
12 let listen = TcpListener::bind("127.0.0.1:0").unwrap();
14 while let Ok(_) = listen.accept() {}
17 for _ in 0..3 { thread::yield_now(); }
18 println!("Exiting main thread");