Remove unneeded spawn in std::timer, and annotate a FIXME

This commit is contained in:
Tim Chevalier
2012-06-14 19:01:12 -07:00
parent 6969f0f2fc
commit bc507c4ef5
+1 -4
View File
@@ -25,8 +25,6 @@
"]
fn delayed_send<T: copy send>(iotask: iotask,
msecs: uint, ch: comm::chan<T>, val: T) {
// FIME: Looks like we don't need to spawn here
task::spawn() {||
unsafe {
let timer_done_po = comm::port::<()>();
let timer_done_ch = comm::chan(timer_done_po);
@@ -59,7 +57,6 @@ fn delayed_send<T: copy send>(iotask: iotask,
comm::send(ch, copy(val));
// uv_close for this timer has been processed
comm::recv(timer_done_po);
}
};
}
@@ -106,7 +103,7 @@ fn recv_timeout<T: copy send>(iotask: iotask,
let timeout_po = comm::port::<()>();
let timeout_ch = comm::chan(timeout_po);
delayed_send(iotask, msecs, timeout_ch, ());
// FIXME: This could be written clearer
// FIXME: This could be written clearer (#2618)
either::either(
{|left_val|
log(debug, #fmt("recv_time .. left_val %?",