Skip to content

Commit e0f110a

Browse files
olsonjefferybrson
authored andcommitted
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..
1 parent 31ba223 commit e0f110a

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/libstd/uv_hl.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ unsafe fn run_high_level_loop(loop_ptr: *libc::c_void,
112112
let async_handle = ptr::addr_of(async);
113113
// associate the async handle with the loop
114114
ll::async_init(loop_ptr, async_handle, high_level_wake_up_cb);
115-
115+
116116
// initialize our loop data and store it in the loop
117117
let data: global_loop_data = {
118118
async_handle: async_handle,
@@ -256,7 +256,7 @@ crust fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe {
256256
handle));
257257
// TODO: iterate through open handles on the loop and uv_close()
258258
// them all
259-
let data = ll::get_data_for_uv_handle(handle) as *global_loop_data;
259+
//let data = ll::get_data_for_uv_handle(handle) as *global_loop_data;
260260
}
261261

262262
fn high_level_tear_down(data: *global_loop_data) unsafe {
@@ -458,12 +458,11 @@ mod test {
458458
};
459459
log(debug, "exiting simple timer cb");
460460
}
461-
#[test]
462-
fn test_uv_hl_simple_timer() unsafe {
461+
462+
fn impl_uv_hl_simple_timer(hl_loop: high_level_loop) unsafe {
463463
let exit_po = comm::port::<bool>();
464464
let exit_ch = comm::chan(exit_po);
465465
let exit_ch_ptr = ptr::addr_of(exit_ch);
466-
let hl_loop = get_global_loop();
467466
let timer_handle = ll::timer_t();
468467
let timer_ptr = ptr::addr_of(timer_handle);
469468
interact(hl_loop) {|loop_ptr|
@@ -489,4 +488,11 @@ mod test {
489488
comm::recv(exit_po);
490489
log(debug, "test_uv_hl_simple_timer: msg recv on exit_po, done..");
491490
}
491+
#[test]
492+
#[ignore(cfg(target_os = "freebsd"))]
493+
fn test_uv_hl_high_level_global_timer() unsafe {
494+
let hl_loop = get_global_loop();
495+
impl_uv_hl_simple_timer(hl_loop);
496+
impl_uv_hl_simple_timer(hl_loop);
497+
}
492498
}

src/rt/rust_kernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ rust_kernel::rust_kernel(rust_env *env) :
2727
// set up storage of pointers needed to
2828
// access the global loop.
2929
global_loop_chan = 0;
30-
global_async_handle = (void**)::malloc( // FIXME -- can use this->malloc()
31-
sizeof(void*)); // .. what do?
30+
global_async_handle = (void**)::malloc( // FIXME--can't use this->malloc()
31+
sizeof(void*)); // .. what do?
3232
*global_async_handle = (void*)0;
3333

3434
// Create the single threaded scheduler that will run on the platform's

0 commit comments

Comments
 (0)