diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-08 18:21:49 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-27 10:14:50 -0700 |
| commit | bb9172d7b512c36f34d34b024640f030d1fde2eb (patch) | |
| tree | 0e4ea18ae30a12954db6b9fbe95f62222ade9301 /src/libsync/task_pool.rs | |
| parent | bdd24b2a56e8bf6b952bd8880364fb0a57c2c540 (diff) | |
| download | rust-bb9172d7b512c36f34d34b024640f030d1fde2eb.tar.gz rust-bb9172d7b512c36f34d34b024640f030d1fde2eb.zip | |
Fix fallout of removing default bounds
This is all purely fallout of getting the previous commit to compile.
Diffstat (limited to 'src/libsync/task_pool.rs')
| -rw-r--r-- | src/libsync/task_pool.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsync/task_pool.rs b/src/libsync/task_pool.rs index 709dafd5b93..e1764f970c7 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(&T)), + Execute(proc:Send(&T)), 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(uint) -> T) + init_fn_factory: || -> proc:Send(uint) -> T) -> TaskPool<T> { assert!(n_tasks >= 1); @@ -49,7 +49,7 @@ impl<T> TaskPool<T> { let (tx, rx) = channel::<Msg<T>>(); let init_fn = init_fn_factory(); - let task_body: proc() = proc() { + let task_body = proc() { let local_data = init_fn(i); loop { match rx.recv() { @@ -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(&T)) { + pub fn execute(&mut self, f: proc:Send(&T)) { 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(uint) -> uint = || { - let g: proc(uint) -> uint = proc(i) i; + let f: || -> proc:Send(uint) -> uint = || { + let g: proc:Send(uint) -> uint = proc(i) i; g }; let mut pool = TaskPool::new(4, f); |
