Skip to content

Instantly share code, notes, and snippets.

@olsonjeffery
Created February 13, 2012 00:45
Show Gist options
  • Save olsonjeffery/1812246 to your computer and use it in GitHub Desktop.
Save olsonjeffery/1812246 to your computer and use it in GitHub Desktop.
// the main loop
let keep_going = true;
let uv_has_begun = false;
while (keep_going) {
let new_msg = comm::recv(rust_loop_port);
alt new_msg {
msg_run() {
// call uv_run()
if (uv_has_begun) {
fail "uv_run() already called";
}
// because of how enclosing the scheduler is
// set up, libuv should be able to claim a
// whole OS thread to itself...
task::spawn {||
// this will block
rustrt::rust_uvtmp_uv_run(uv_loop_t);
// and when it ends..
keep_going = false;
};
}
msg_loop_delete() {
// call into libuv, then..
keep_going = false;
}
msg_timer_init() {
// get uv_timer_t
}
msg_timer_start(delay, repeat, cb) {
// kick off the timer in uv..
}
_ {
fail "unknown form of uv::uv_msg received";
}
}
}
};
src/libstd/uvtmp.rs:80 map::new_bytes_hash();
src/libstd/uvtmp.rs:100:24: 100:34 error: assigning to upvar
src/libstd/uvtmp.rs:100 keep_going = false;
^~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment