From c3ea3e439fbc5251279d914a95cd8344556982cb Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 7 Apr 2014 13:30:48 -0700 Subject: Register new snapshots --- src/libsync/future.rs | 6 +++--- src/libsync/task_pool.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/libsync') diff --git a/src/libsync/future.rs b/src/libsync/future.rs index cfe942afc12..ac4150a67e0 100644 --- a/src/libsync/future.rs +++ b/src/libsync/future.rs @@ -34,7 +34,7 @@ pub struct Future { } enum FutureState { - Pending(proc:Send() -> A), + Pending(proc():Send -> A), Evaluating, Forced(A) } @@ -90,7 +90,7 @@ impl Future { Future {state: Forced(val)} } - pub fn from_fn(f: proc:Send() -> A) -> Future { + pub fn from_fn(f: proc():Send -> A) -> Future { /*! * Create a future from a function. * @@ -117,7 +117,7 @@ impl Future { }) } - pub fn spawn(blk: proc:Send() -> A) -> Future { + pub fn spawn(blk: proc():Send -> A) -> Future { /*! * Create a future from a unique closure. * diff --git a/src/libsync/task_pool.rs b/src/libsync/task_pool.rs index fc249996882..75e5d19b2e2 100644 --- a/src/libsync/task_pool.rs +++ b/src/libsync/task_pool.rs @@ -16,7 +16,7 @@ use std::task; enum Msg { - Execute(proc:Send(&T)), + Execute(proc(&T):Send), Quit } @@ -41,7 +41,7 @@ impl TaskPool { /// returns a function which, given the index of the task, should return /// local data to be kept around in that task. pub fn new(n_tasks: uint, - init_fn_factory: || -> proc:Send(uint) -> T) + init_fn_factory: || -> proc(uint):Send -> T) -> TaskPool { assert!(n_tasks >= 1); @@ -73,7 +73,7 @@ impl TaskPool { /// Executes the function `f` on a task in the pool. The function /// receives a reference to the local data returned by the `init_fn`. - pub fn execute(&mut self, f: proc:Send(&T)) { + pub fn execute(&mut self, f: proc(&T):Send) { self.channels.get(self.next_index).send(Execute(f)); self.next_index += 1; if self.next_index == self.channels.len() { self.next_index = 0; } @@ -82,8 +82,8 @@ impl TaskPool { #[test] fn test_task_pool() { - let f: || -> proc:Send(uint) -> uint = || { - let g: proc:Send(uint) -> uint = proc(i) i; + let f: || -> proc(uint):Send -> uint = || { + let g: proc(uint):Send -> uint = proc(i) i; g }; let mut pool = TaskPool::new(4, f); -- cgit 1.4.1-3-g733a5