Closed
Description
use std::comm;
use std::rt::io::timer::Timer;
fn main() {
let (port, chan) = comm::stream();
do spawn {
let mut timer = Timer::new().unwrap();
timer.sleep(10);
chan.send(());
}
loop {
if port.peek() {
break;
}
}
port.recv();
}
This will often never leave the loop. If the timer is removed, it always succeeds instantly. If the peek is removed (so we block on receiving), it always succeeds once the sleep terminates.