about summary refs log tree commit diff
path: root/src/librustrt/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustrt/task.rs')
-rw-r--r--src/librustrt/task.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustrt/task.rs b/src/librustrt/task.rs
index 325bdc284ac..7e657d3aef3 100644
--- a/src/librustrt/task.rs
+++ b/src/librustrt/task.rs
@@ -22,6 +22,7 @@ use core::atomic::{AtomicUint, SeqCst};
 use core::iter::{IteratorExt, Take};
 use core::kinds::marker;
 use core::mem;
+use core::ops::FnMut;
 use core::prelude::{Clone, Drop, Err, Iterator, None, Ok, Option, Send, Some};
 use core::prelude::{drop};
 
@@ -297,9 +298,9 @@ impl Task {
     // `awoken` field which indicates whether we were actually woken up via some
     // invocation of `reawaken`. This flag is only ever accessed inside the
     // lock, so there's no need to make it atomic.
-    pub fn deschedule(mut self: Box<Task>,
-                      times: uint,
-                      f: |BlockedTask| -> ::core::result::Result<(), BlockedTask>) {
+    pub fn deschedule<F>(mut self: Box<Task>, times: uint, mut f: F) where
+        F: FnMut(BlockedTask) -> ::core::result::Result<(), BlockedTask>,
+    {
         unsafe {
             let me = &mut *self as *mut Task;
             let task = BlockedTask::block(self);