diff options
| author | bors <bors@rust-lang.org> | 2013-06-28 12:05:12 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-28 12:05:12 -0700 |
| commit | f44b951a1ea40b61508b2d0abb3f239797f885c5 (patch) | |
| tree | 326ffc88eb48938b5c57daad927cf6e7462a13e1 /src/libstd/task | |
| parent | 4e4e2f70c90f01b5be22a192c883b9dcb34df7ff (diff) | |
| parent | 4f044891a5457acb06338c78f9aa58d8b4c9d53f (diff) | |
| download | rust-f44b951a1ea40b61508b2d0abb3f239797f885c5.tar.gz rust-f44b951a1ea40b61508b2d0abb3f239797f885c5.zip | |
auto merge of #7451 : cmr/rust/rewrite-each-path, r=pcwalton
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/mod.rs | 8 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index b558b9d53a3..a8e8cfd163a 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -353,7 +353,7 @@ impl TaskBuilder { } /// Runs a task, while transfering ownership of one argument to the child. - pub fn spawn_with<A:Owned>(&mut self, arg: A, f: ~fn(v: A)) { + pub fn spawn_with<A:Send>(&mut self, arg: A, f: ~fn(v: A)) { let arg = Cell::new(arg); do self.spawn { f(arg.take()); @@ -373,7 +373,7 @@ impl TaskBuilder { * # Failure * Fails if a future_result was already set for this task. */ - pub fn try<T:Owned>(&mut self, f: ~fn() -> T) -> Result<T,()> { + pub fn try<T:Send>(&mut self, f: ~fn() -> T) -> Result<T,()> { let (po, ch) = stream::<T>(); let mut result = None; @@ -445,7 +445,7 @@ pub fn spawn_supervised(f: ~fn()) { task.spawn(f) } -pub fn spawn_with<A:Owned>(arg: A, f: ~fn(v: A)) { +pub fn spawn_with<A:Send>(arg: A, f: ~fn(v: A)) { /*! * Runs a task, while transfering ownership of one argument to the * child. @@ -478,7 +478,7 @@ pub fn spawn_sched(mode: SchedMode, f: ~fn()) { task.spawn(f) } -pub fn try<T:Owned>(f: ~fn() -> T) -> Result<T,()> { +pub fn try<T:Send>(f: ~fn() -> T) -> Result<T,()> { /*! * Execute a function in another task and return either the return value * of the function or result::err. diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 95fc53c1b55..8f06fede057 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -636,7 +636,8 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) { let child_data = Cell::new((notify_chan, child_arc, ancestors)); let result: ~fn() = || { // Agh. Get move-mode items into the closure. FIXME (#2829) - let mut (notify_chan, child_arc, ancestors) = child_data.take(); + let (notify_chan, child_arc, ancestors) = child_data.take(); + let mut ancestors = ancestors; // Child task runs this code. // Even if the below code fails to kick the child off, we must |
