diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-12-11 13:50:04 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-12-13 15:52:50 -0800 |
| commit | ed4fac01b5e207df0f0c7e0ea964bd3088826d27 (patch) | |
| tree | abae4bd8b385afdfbba28988560992683102970b /src/libcore/task | |
| parent | a277081ee481174cd28f7e85aaf1c4de912cbf4f (diff) | |
| download | rust-ed4fac01b5e207df0f0c7e0ea964bd3088826d27.tar.gz rust-ed4fac01b5e207df0f0c7e0ea964bd3088826d27.zip | |
Rename Send trait to Owned
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/mod.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcore/task/mod.rs b/src/libcore/task/mod.rs index d9b040abf7b..1ba2c1dc2c1 100644 --- a/src/libcore/task/mod.rs +++ b/src/libcore/task/mod.rs @@ -425,7 +425,7 @@ impl TaskBuilder { spawn::spawn_raw(move opts, (x.gen_body)(move f)); } /// Runs a task, while transfering ownership of one argument to the child. - fn spawn_with<A: Send>(arg: A, f: fn~(v: A)) { + fn spawn_with<A: Owned>(arg: A, f: fn~(v: A)) { let arg = ~mut Some(move arg); do self.spawn |move arg, move f| { f(option::swap_unwrap(arg)) @@ -443,7 +443,7 @@ impl TaskBuilder { * otherwise be required to establish communication from the parent * to the child. */ - fn spawn_listener<A: Send>(f: fn~(comm::Port<A>)) -> comm::Chan<A> { + fn spawn_listener<A: Owned>(f: fn~(comm::Port<A>)) -> comm::Chan<A> { let setup_po = comm::Port(); let setup_ch = comm::Chan(&setup_po); do self.spawn |move f| { @@ -458,7 +458,7 @@ impl TaskBuilder { /** * Runs a new task, setting up communication in both directions */ - fn spawn_conversation<A: Send, B: Send> + fn spawn_conversation<A: Owned, B: Owned> (f: fn~(comm::Port<A>, comm::Chan<B>)) -> (comm::Port<B>, comm::Chan<A>) { let from_child = comm::Port(); @@ -482,7 +482,7 @@ impl TaskBuilder { * # Failure * Fails if a future_result was already set for this task. */ - fn try<T: Send>(f: fn~() -> T) -> Result<T,()> { + fn try<T: Owned>(f: fn~() -> T) -> Result<T,()> { let po = comm::Port(); let ch = comm::Chan(&po); let mut result = None; @@ -552,7 +552,7 @@ pub fn spawn_supervised(f: fn~()) { task().supervised().spawn(move f) } -pub fn spawn_with<A:Send>(arg: A, f: fn~(v: A)) { +pub fn spawn_with<A:Owned>(arg: A, f: fn~(v: A)) { /*! * Runs a task, while transfering ownership of one argument to the * child. @@ -566,7 +566,7 @@ pub fn spawn_with<A:Send>(arg: A, f: fn~(v: A)) { task().spawn_with(move arg, move f) } -pub fn spawn_listener<A:Send>(f: fn~(comm::Port<A>)) -> comm::Chan<A> { +pub fn spawn_listener<A:Owned>(f: fn~(comm::Port<A>)) -> comm::Chan<A> { /*! * Runs a new task while providing a channel from the parent to the child * @@ -576,7 +576,7 @@ pub fn spawn_listener<A:Send>(f: fn~(comm::Port<A>)) -> comm::Chan<A> { task().spawn_listener(move f) } -pub fn spawn_conversation<A: Send, B: Send> +pub fn spawn_conversation<A: Owned, B: Owned> (f: fn~(comm::Port<A>, comm::Chan<B>)) -> (comm::Port<B>, comm::Chan<A>) { /*! @@ -605,7 +605,7 @@ pub fn spawn_sched(mode: SchedMode, f: fn~()) { task().sched_mode(mode).spawn(move f) } -pub fn try<T:Send>(f: fn~() -> T) -> Result<T,()> { +pub fn try<T:Owned>(f: fn~() -> T) -> Result<T,()> { /*! * Execute a function in another task and return either the return value * of the function or result::err. |
