diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-04-07 13:30:48 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-04-08 00:03:11 -0700 |
| commit | c3ea3e439fbc5251279d914a95cd8344556982cb (patch) | |
| tree | c179b27b1d04dd7bfa17ab59b695c91fcd64320f /src/libsync | |
| parent | c83afb9719ad6e2ae7d819b8096524e1147c4065 (diff) | |
| download | rust-c3ea3e439fbc5251279d914a95cd8344556982cb.tar.gz rust-c3ea3e439fbc5251279d914a95cd8344556982cb.zip | |
Register new snapshots
Diffstat (limited to 'src/libsync')
| -rw-r--r-- | src/libsync/future.rs | 6 | ||||
| -rw-r--r-- | src/libsync/task_pool.rs | 10 |
2 files changed, 8 insertions, 8 deletions
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<A> { } enum FutureState<A> { - Pending(proc:Send() -> A), + Pending(proc():Send -> A), Evaluating, Forced(A) } @@ -90,7 +90,7 @@ impl<A> Future<A> { Future {state: Forced(val)} } - pub fn from_fn(f: proc:Send() -> A) -> Future<A> { + pub fn from_fn(f: proc():Send -> A) -> Future<A> { /*! * Create a future from a function. * @@ -117,7 +117,7 @@ impl<A:Send> Future<A> { }) } - pub fn spawn(blk: proc:Send() -> A) -> Future<A> { + pub fn spawn(blk: proc():Send -> A) -> Future<A> { /*! * 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<T> { - Execute(proc:Send(&T)), + Execute(proc(&T):Send), Quit } @@ -41,7 +41,7 @@ impl<T> TaskPool<T> { /// 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<T> { assert!(n_tasks >= 1); @@ -73,7 +73,7 @@ impl<T> TaskPool<T> { /// 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<T> TaskPool<T> { #[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); |
