aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/util/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/util/task.rs')
-rw-r--r--src/components/util/task.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/util/task.rs b/src/components/util/task.rs
index 49b22348dfa..e487c0b26fa 100644
--- a/src/components/util/task.rs
+++ b/src/components/util/task.rs
@@ -2,24 +2,24 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use std::str::IntoMaybeOwned;
use std::task;
-use std::comm::SharedChan;
+use std::comm::Chan;
use std::task::TaskBuilder;
-pub fn spawn_named<S: IntoSendStr>(name: S, f: proc()) {
- let mut builder = task::task();
- builder.name(name);
+pub fn spawn_named<S: IntoMaybeOwned<'static>>(name: S, f: proc()) {
+ let builder = task::task().named(name);
builder.spawn(f);
}
/// Arrange to send a particular message to a channel if the task built by
/// this `TaskBuilder` fails.
-pub fn send_on_failure<T: Send>(builder: &mut TaskBuilder, msg: T, dest: SharedChan<T>) {
+pub fn send_on_failure<T: Send>(builder: &mut TaskBuilder, msg: T, dest: Chan<T>) {
let port = builder.future_result();
- do spawn {
+ spawn(proc() {
match port.recv() {
Ok(()) => (),
Err(..) => dest.send(msg),
}
- }
+ })
}