Closed
Description
Repro:
extern crate time;
use std::io::IoResult;
use std::io::timer::Timer;
use std::sync::Future;
fn repro() -> IoResult<()> {
let (tx, rx): (SyncSender<&'static str>, Receiver<&'static str>) = sync_channel(3);
let mut f = Future::spawn(proc() {
let mut timer = try!(Timer::new());
let tick = timer.periodic(10000);
loop {
println!("select; {}", time::precise_time_ns());
select! {
_ = tick.recv() => {
fail!("nope, received tick first; {}", time::precise_time_ns());
},
msg = rx.recv() => {
println!("Received msg; {}", msg);
if msg == "hi2u" {
break;
}
}
}
}
Ok(())
});
tx.try_send("zomg").unwrap();
tx.try_send("hi2u").unwrap();
f.get()
}
pub fn main() {
let mut i = 0u;
loop {
i += 1;
println!("starting iter {}; {}", i, time::precise_time_ns());
repro().unwrap();
}
}
Metadata
Metadata
Assignees
Labels
No labels