Created
February 13, 2012 00:45
-
-
Save olsonjeffery/1812246 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; | |
} | |
} | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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