mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 14:13:38 +00:00
clean and trying the global loop test as two separate loop lifetimes..
.. seeing an occasional valgrind/barf spew on some invalid read/writes.. need to investigate further.. i think its related to my poor citizen conduct, re: pointers stashed in rust_kernel..
This commit is contained in:
parent
31ba223c26
commit
e0f110aa12
@ -112,7 +112,7 @@ unsafe fn run_high_level_loop(loop_ptr: *libc::c_void,
|
|||||||
let async_handle = ptr::addr_of(async);
|
let async_handle = ptr::addr_of(async);
|
||||||
// associate the async handle with the loop
|
// associate the async handle with the loop
|
||||||
ll::async_init(loop_ptr, async_handle, high_level_wake_up_cb);
|
ll::async_init(loop_ptr, async_handle, high_level_wake_up_cb);
|
||||||
|
|
||||||
// initialize our loop data and store it in the loop
|
// initialize our loop data and store it in the loop
|
||||||
let data: global_loop_data = {
|
let data: global_loop_data = {
|
||||||
async_handle: async_handle,
|
async_handle: async_handle,
|
||||||
@ -256,7 +256,7 @@ crust fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe {
|
|||||||
handle));
|
handle));
|
||||||
// TODO: iterate through open handles on the loop and uv_close()
|
// TODO: iterate through open handles on the loop and uv_close()
|
||||||
// them all
|
// them all
|
||||||
let data = ll::get_data_for_uv_handle(handle) as *global_loop_data;
|
//let data = ll::get_data_for_uv_handle(handle) as *global_loop_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn high_level_tear_down(data: *global_loop_data) unsafe {
|
fn high_level_tear_down(data: *global_loop_data) unsafe {
|
||||||
@ -458,12 +458,11 @@ mod test {
|
|||||||
};
|
};
|
||||||
log(debug, "exiting simple timer cb");
|
log(debug, "exiting simple timer cb");
|
||||||
}
|
}
|
||||||
#[test]
|
|
||||||
fn test_uv_hl_simple_timer() unsafe {
|
fn impl_uv_hl_simple_timer(hl_loop: high_level_loop) unsafe {
|
||||||
let exit_po = comm::port::<bool>();
|
let exit_po = comm::port::<bool>();
|
||||||
let exit_ch = comm::chan(exit_po);
|
let exit_ch = comm::chan(exit_po);
|
||||||
let exit_ch_ptr = ptr::addr_of(exit_ch);
|
let exit_ch_ptr = ptr::addr_of(exit_ch);
|
||||||
let hl_loop = get_global_loop();
|
|
||||||
let timer_handle = ll::timer_t();
|
let timer_handle = ll::timer_t();
|
||||||
let timer_ptr = ptr::addr_of(timer_handle);
|
let timer_ptr = ptr::addr_of(timer_handle);
|
||||||
interact(hl_loop) {|loop_ptr|
|
interact(hl_loop) {|loop_ptr|
|
||||||
@ -489,4 +488,11 @@ mod test {
|
|||||||
comm::recv(exit_po);
|
comm::recv(exit_po);
|
||||||
log(debug, "test_uv_hl_simple_timer: msg recv on exit_po, done..");
|
log(debug, "test_uv_hl_simple_timer: msg recv on exit_po, done..");
|
||||||
}
|
}
|
||||||
|
#[test]
|
||||||
|
#[ignore(cfg(target_os = "freebsd"))]
|
||||||
|
fn test_uv_hl_high_level_global_timer() unsafe {
|
||||||
|
let hl_loop = get_global_loop();
|
||||||
|
impl_uv_hl_simple_timer(hl_loop);
|
||||||
|
impl_uv_hl_simple_timer(hl_loop);
|
||||||
|
}
|
||||||
}
|
}
|
@ -27,8 +27,8 @@ rust_kernel::rust_kernel(rust_env *env) :
|
|||||||
// set up storage of pointers needed to
|
// set up storage of pointers needed to
|
||||||
// access the global loop.
|
// access the global loop.
|
||||||
global_loop_chan = 0;
|
global_loop_chan = 0;
|
||||||
global_async_handle = (void**)::malloc( // FIXME -- can use this->malloc()
|
global_async_handle = (void**)::malloc( // FIXME--can't use this->malloc()
|
||||||
sizeof(void*)); // .. what do?
|
sizeof(void*)); // .. what do?
|
||||||
*global_async_handle = (void*)0;
|
*global_async_handle = (void*)0;
|
||||||
|
|
||||||
// Create the single threaded scheduler that will run on the platform's
|
// Create the single threaded scheduler that will run on the platform's
|
||||||
|
Loading…
Reference in New Issue
Block a user