about summary refs log tree commit diff
path: root/src/libsync
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-08 18:21:49 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-03-27 10:14:50 -0700
commitbb9172d7b512c36f34d34b024640f030d1fde2eb (patch)
tree0e4ea18ae30a12954db6b9fbe95f62222ade9301 /src/libsync
parentbdd24b2a56e8bf6b952bd8880364fb0a57c2c540 (diff)
downloadrust-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')
-rw-r--r--src/libsync/future.rs6
-rw-r--r--src/libsync/raw.rs4
-rw-r--r--src/libsync/task_pool.rs12
3 files changed, 11 insertions, 11 deletions
diff --git a/src/libsync/future.rs b/src/libsync/future.rs
index 74a15dc9f0e..8fc3dd3a460 100644
--- a/src/libsync/future.rs
+++ b/src/libsync/future.rs
@@ -34,7 +34,7 @@ pub struct Future<A> {
 }
 
 enum FutureState<A> {
-    Pending(proc() -> 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() -> 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() -> A) -> Future<A> {
+    pub fn spawn(blk: proc:Send() -> A) -> Future<A> {
         /*!
          * Create a future from a unique closure.
          *
diff --git a/src/libsync/raw.rs b/src/libsync/raw.rs
index 36f0748fe71..0cb9bf77ac9 100644
--- a/src/libsync/raw.rs
+++ b/src/libsync/raw.rs
@@ -836,7 +836,7 @@ mod tests {
         let m = Arc::new(Mutex::new());
         let m2 = m.clone();
 
-        let result: result::Result<(), ~Any> = task::try(proc() {
+        let result: result::Result<(), ~Any:Send> = task::try(proc() {
             let _lock = m2.lock();
             fail!();
         });
@@ -1076,7 +1076,7 @@ mod tests {
         let x = Arc::new(RWLock::new());
         let x2 = x.clone();
 
-        let result: result::Result<(), ~Any> = task::try(proc() {
+        let result: result::Result<(), ~Any:Send> = task::try(proc() {
             lock_rwlock_in_mode(&x2, mode1, || {
                 fail!();
             })
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);