about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-05-24 21:48:40 -0700
committerBrian Anderson <banderson@mozilla.com>2012-05-24 21:50:35 -0700
commit623acaa0139b77984ec93a0e0002b7149343ae37 (patch)
tree12c83ca6cd2da32cd2f45f009dac87db127d5993 /src/libstd
parent444ff687a299721247ae008abdeca9b32fc958dd (diff)
downloadrust-623acaa0139b77984ec93a0e0002b7149343ae37.tar.gz
rust-623acaa0139b77984ec93a0e0002b7149343ae37.zip
std: Remove unused args from run_high_level_loop
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/uv_global_loop.rs31
-rw-r--r--src/libstd/uv_hl.rs46
2 files changed, 19 insertions, 58 deletions
diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs
index 6f882052370..377ba190825 100644
--- a/src/libstd/uv_global_loop.rs
+++ b/src/libstd/uv_global_loop.rs
@@ -103,29 +103,14 @@ fn spawn_high_level_loop() -> hl::high_level_loop unsafe {
             #debug("global libuv task is now weak %?", weak_exit_po);
             let loop_msg_po = port::<hl::high_level_msg>();
             let loop_msg_ch = loop_msg_po.chan();
-            hl::run_high_level_loop(
-                loop_msg_po,
-                // before_run
-                {|async_handle|
-                    #debug("global libuv: before_run %?", async_handle);
-                    let hll = hl::high_level_loop({
-                        async_handle: async_handle,
-                        op_chan: loop_msg_ch
-                    });
-                    exit_ch.send(hll);
-                },
-                // before_msg_process
-                {|async_handle, loop_active|
-                    #debug("global libuv: before_msg_drain %? %?",
-                           async_handle, loop_active);
-                    true
-                },
-                // before_tear_down
-                {|async_handle|
-                    #debug("libuv task: before_tear_down %?",
-                           async_handle);
-                }
-            );
+            hl::run_high_level_loop(loop_msg_po) {|async_handle|
+                #debug("global libuv: before_run %?", async_handle);
+                let hll = hl::high_level_loop({
+                    async_handle: async_handle,
+                    op_chan: loop_msg_ch
+                });
+                exit_ch.send(hll);
+            }
             #debug("global libuv task is leaving weakened state");
         };
         #debug("global libuv task exiting");
diff --git a/src/libstd/uv_hl.rs b/src/libstd/uv_hl.rs
index 5b734af4324..b3663116042 100644
--- a/src/libstd/uv_hl.rs
+++ b/src/libstd/uv_hl.rs
@@ -61,10 +61,7 @@ the loop's msg port
 provided `async_handle`. `uv_run` should return shortly after
 "]
 unsafe fn run_high_level_loop(msg_po: port<high_level_msg>,
-                              before_run: fn~(*ll::uv_async_t),
-                              before_msg_process:
-                                fn~(*ll::uv_async_t, bool) -> bool,
-                              before_tear_down: fn~(*ll::uv_async_t)) {
+                              before_run: fn~(*ll::uv_async_t)) {
     let loop_ptr = ll::loop_new();
     // set up the special async handle we'll use to allow multi-task
     // communication with this loop
@@ -77,8 +74,6 @@ unsafe fn run_high_level_loop(msg_po: port<high_level_msg>,
     let data: hl_loop_data = {
         async_handle: async_handle,
         mut active: true,
-        before_msg_process: before_msg_process,
-        before_tear_down: before_tear_down,
         msg_po_ptr: addr_of(msg_po)
     };
     ll::set_data_for_uv_handle(async_handle, addr_of(data));
@@ -130,8 +125,6 @@ fn exit(hl_loop: high_level_loop) unsafe {
 type hl_loop_data = {
     async_handle: *ll::uv_async_t,
     mut active: bool,
-    before_msg_process: fn~(*ll::uv_async_t, bool) -> bool,
-    before_tear_down: fn~(*ll::uv_async_t),
     msg_po_ptr: *port<high_level_msg>
 };
 
@@ -160,8 +153,6 @@ crust fn high_level_wake_up_cb(async_handle: *ll::uv_async_t,
             if (*data).active {
                 alt msg {
                   interaction(cb) {
-                    (*data).before_msg_process(async_handle,
-                                               (*data).active);
                     cb(loop_ptr);
                   }
                   teardown_loop {
@@ -189,7 +180,6 @@ fn begin_teardown(data: *hl_loop_data) unsafe {
     log(debug, "high_level_tear_down() called, close async_handle");
     // call user-suppled before_tear_down cb
     let async_handle = (*data).async_handle;
-    (*data).before_tear_down(async_handle);
     ll::close(async_handle as *c_void, tear_down_close_cb);
 }
 
@@ -236,30 +226,16 @@ mod test {
         task::spawn_sched(task::manual_threads(1u)) {||
             let msg_po = comm::port::<high_level_msg>();
             let msg_ch = comm::chan(msg_po);
-            run_high_level_loop(
-                msg_po,
-                // before_run
-                {|async_handle|
-                    log(debug,#fmt("hltest before_run: async_handle %?",
-                                  async_handle));
-                    // do an async_send with it
-                    ll::async_send(async_handle);
-                    comm::send(hl_loop_ch, high_level_loop({
-                       async_handle: async_handle,
-                       op_chan: msg_ch
-                    }));
-                },
-                // before_msg_drain
-                {|async_handle, status|
-                    log(debug,#fmt("hltest before_msg_drain: handle %? %?",
-                                  async_handle, status));
-                    true
-                },
-                // before_tear_down
-                {|async_handle|
-                    log(debug,#fmt("hl test_loop b4_tear_down: async %?",
-                                  async_handle));
-            });
+            run_high_level_loop(msg_po) {|async_handle|
+                log(debug,#fmt("hltest before_run: async_handle %?",
+                               async_handle));
+                // do an async_send with it
+                ll::async_send(async_handle);
+                comm::send(hl_loop_ch, high_level_loop({
+                    async_handle: async_handle,
+                    op_chan: msg_ch
+                }));
+            }
             comm::send(exit_ch, ());
         };
         ret comm::recv(hl_loop_port);