about summary refs log tree commit diff
path: root/src/libstd/timer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/timer.rs')
-rw-r--r--src/libstd/timer.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs
index 1476d6bdf31..2aca87b942e 100644
--- a/src/libstd/timer.rs
+++ b/src/libstd/timer.rs
@@ -1,15 +1,12 @@
 //! Utilities that leverage libuv's `uv_timer_*` API
 
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
+// tjc: forbid deprecated modes again after snap
 
 use uv = uv;
 use uv::iotask;
 use iotask::IoTask;
 use comm = core::comm;
 
-export delayed_send, sleep, recv_timeout;
-
 /**
  * Wait for timeout period then send provided value over a channel
  *
@@ -26,14 +23,14 @@ export delayed_send, sleep, recv_timeout;
  * * ch - a channel of type T to send a `val` on
  * * val - a value of type T to send over the provided `ch`
  */
-fn delayed_send<T: Copy Send>(iotask: IoTask,
-                              msecs: uint, ch: comm::Chan<T>, +val: T) {
+pub fn delayed_send<T: Copy Send>(iotask: IoTask,
+                                  msecs: uint, ch: comm::Chan<T>, val: T) {
         unsafe {
             let timer_done_po = core::comm::Port::<()>();
             let timer_done_ch = core::comm::Chan(timer_done_po);
-            let timer_done_ch_ptr = ptr::addr_of(timer_done_ch);
+            let timer_done_ch_ptr = ptr::addr_of(&timer_done_ch);
             let timer = uv::ll::timer_t();
-            let timer_ptr = ptr::addr_of(timer);
+            let timer_ptr = ptr::addr_of(&timer);
             do iotask::interact(iotask) |loop_ptr| unsafe {
                 let init_result = uv::ll::timer_init(loop_ptr, timer_ptr);
                 if (init_result == 0i32) {
@@ -75,7 +72,7 @@ fn delayed_send<T: Copy Send>(iotask: IoTask,
  * * `iotask` - a `uv::iotask` that the tcp request will run on
  * * msecs - an amount of time, in milliseconds, for the current task to block
  */
-fn sleep(iotask: IoTask, msecs: uint) {
+pub fn sleep(iotask: IoTask, msecs: uint) {
     let exit_po = core::comm::Port::<()>();
     let exit_ch = core::comm::Chan(exit_po);
     delayed_send(iotask, msecs, exit_ch, ());
@@ -102,7 +99,7 @@ fn sleep(iotask: IoTask, msecs: uint) {
  * on the provided port in the allotted timeout period, then the result will
  * be a `some(T)`. If not, then `none` will be returned.
  */
-fn recv_timeout<T: Copy Send>(iotask: IoTask,
+pub fn recv_timeout<T: Copy Send>(iotask: IoTask,
                               msecs: uint,
                               wait_po: comm::Port<T>) -> Option<T> {
     let timeout_po = comm::Port::<()>();