about summary refs log tree commit diff
path: root/src/libcore/task
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/task')
-rw-r--r--src/libcore/task/local_data.rs2
-rw-r--r--src/libcore/task/local_data_priv.rs2
-rw-r--r--src/libcore/task/mod.rs8
-rw-r--r--src/libcore/task/spawn.rs14
4 files changed, 13 insertions, 13 deletions
diff --git a/src/libcore/task/local_data.rs b/src/libcore/task/local_data.rs
index 72c328d4613..690b3aedc5a 100644
--- a/src/libcore/task/local_data.rs
+++ b/src/libcore/task/local_data.rs
@@ -79,7 +79,7 @@ pub unsafe fn local_data_set<T:Durable>(
  */
 pub unsafe fn local_data_modify<T:Durable>(
     key: LocalDataKey<T>,
-    modify_fn: fn(Option<@T>) -> Option<@T>) {
+    modify_fn: &fn(Option<@T>) -> Option<@T>) {
 
     local_modify(rt::rust_get_task(), key, modify_fn)
 }
diff --git a/src/libcore/task/local_data_priv.rs b/src/libcore/task/local_data_priv.rs
index f035916f594..bb05520e1a3 100644
--- a/src/libcore/task/local_data_priv.rs
+++ b/src/libcore/task/local_data_priv.rs
@@ -176,7 +176,7 @@ pub unsafe fn local_set<T:Durable>(
 
 pub unsafe fn local_modify<T:Durable>(
     task: *rust_task, key: LocalDataKey<T>,
-    modify_fn: fn(Option<@T>) -> Option<@T>) {
+    modify_fn: &fn(Option<@T>) -> Option<@T>) {
 
     // Could be more efficient by doing the lookup work, but this is easy.
     let newdata = modify_fn(local_pop(task, key));
diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs
index 065feaebb51..31c44531efe 100644
--- a/src/libcore/task/mod.rs
+++ b/src/libcore/task/mod.rs
@@ -295,7 +295,7 @@ pub impl TaskBuilder {
      * # Failure
      * Fails if a future_result was already set for this task.
      */
-    fn future_result(&self, blk: fn(v: Port<TaskResult>)) -> TaskBuilder {
+    fn future_result(&self, blk: &fn(v: Port<TaskResult>)) -> TaskBuilder {
         // FIXME (#3725): Once linked failure and notification are
         // handled in the library, I can imagine implementing this by just
         // registering an arbitrary number of task::on_exit handlers and
@@ -572,7 +572,7 @@ pub fn get_scheduler() -> Scheduler {
  * }
  * ~~~
  */
-pub unsafe fn unkillable<U>(f: fn() -> U) -> U {
+pub unsafe fn unkillable<U>(f: &fn() -> U) -> U {
     struct AllowFailure {
         t: *rust_task,
         drop {
@@ -597,7 +597,7 @@ pub unsafe fn unkillable<U>(f: fn() -> U) -> U {
 }
 
 /// The inverse of unkillable. Only ever to be used nested in unkillable().
-pub unsafe fn rekillable<U>(f: fn() -> U) -> U {
+pub unsafe fn rekillable<U>(f: &fn() -> U) -> U {
     struct DisallowFailure {
         t: *rust_task,
         drop {
@@ -625,7 +625,7 @@ pub unsafe fn rekillable<U>(f: fn() -> U) -> U {
  * A stronger version of unkillable that also inhibits scheduling operations.
  * For use with exclusive ARCs, which use pthread mutexes directly.
  */
-pub unsafe fn atomically<U>(f: fn() -> U) -> U {
+pub unsafe fn atomically<U>(f: &fn() -> U) -> U {
     struct DeferInterrupts {
         t: *rust_task,
         drop {
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs
index 7b7ec769fa9..a0db2525441 100644
--- a/src/libcore/task/spawn.rs
+++ b/src/libcore/task/spawn.rs
@@ -108,7 +108,7 @@ fn taskset_remove(tasks: &mut TaskSet, task: *rust_task) {
     let was_present = tasks.remove(&task);
     fail_unless!(was_present);
 }
-pub fn taskset_each(tasks: &TaskSet, blk: fn(v: *rust_task) -> bool) {
+pub fn taskset_each(tasks: &TaskSet, blk: &fn(v: *rust_task) -> bool) {
     tasks.each(|k| blk(*k))
 }
 
@@ -151,17 +151,17 @@ struct AncestorNode {
     mut ancestors:    AncestorList,
 }
 
-enum AncestorList = Option<unstable::Exclusive<AncestorNode>>;
+struct AncestorList(Option<unstable::Exclusive<AncestorNode>>);
 
 // Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety.
 #[inline(always)]
-fn access_group<U>(x: &TaskGroupArc, blk: fn(TaskGroupInner) -> U) -> U {
+fn access_group<U>(x: &TaskGroupArc, blk: &fn(TaskGroupInner) -> U) -> U {
     unsafe { x.with(blk) }
 }
 
 #[inline(always)]
 fn access_ancestors<U>(x: &unstable::Exclusive<AncestorNode>,
-                       blk: fn(x: &mut AncestorNode) -> U) -> U {
+                       blk: &fn(x: &mut AncestorNode) -> U) -> U {
     unsafe { x.with(blk) }
 }
 
@@ -175,7 +175,7 @@ fn access_ancestors<U>(x: &unstable::Exclusive<AncestorNode>,
 // allocations. Once that bug is fixed, changing the sigil should suffice.
 fn each_ancestor(list:        &mut AncestorList,
                  bail_opt:    Option<@fn(TaskGroupInner)>,
-                 forward_blk: fn(TaskGroupInner) -> bool)
+                 forward_blk: &fn(TaskGroupInner) -> bool)
               -> bool {
     // "Kickoff" call - there was no last generation.
     return !coalesce(list, bail_opt, forward_blk, uint::max_value);
@@ -184,7 +184,7 @@ fn each_ancestor(list:        &mut AncestorList,
     // whether or not unwinding is needed (i.e., !successful iteration).
     fn coalesce(list:            &mut AncestorList,
                 bail_opt:        Option<@fn(TaskGroupInner)>,
-                forward_blk:     fn(TaskGroupInner) -> bool,
+                forward_blk:     &fn(TaskGroupInner) -> bool,
                 last_generation: uint) -> bool {
         // Need to swap the list out to use it, to appease borrowck.
         let tmp_list = util::replace(&mut *list, AncestorList(None));
@@ -288,7 +288,7 @@ fn each_ancestor(list:        &mut AncestorList,
 
         // Wrapper around exclusive::with that appeases borrowck.
         fn with_parent_tg<U>(parent_group: &mut Option<TaskGroupArc>,
-                             blk: fn(TaskGroupInner) -> U) -> U {
+                             blk: &fn(TaskGroupInner) -> U) -> U {
             // If this trips, more likely the problem is 'blk' failed inside.
             let tmp_arc = option::swap_unwrap(&mut *parent_group);
             let result = do access_group(&tmp_arc) |tg_opt| { blk(tg_opt) };