aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/task.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-18 11:25:00 -0600
committerbors-servo <metajack+bors@gmail.com>2015-03-18 11:25:00 -0600
commit99cf9dbfc107bacb84dfe5afa9539a0ede3beac2 (patch)
treecc36210329cb1a31709a03685c05c4aaa99407e3 /components/util/task.rs
parent65d4b12bf20783ea784f1c61f4b33ec0fc975f4f (diff)
parent5f15eb5fbfb7a8649132cc8b3a07314389836714 (diff)
downloadservo-99cf9dbfc107bacb84dfe5afa9539a0ede3beac2.tar.gz
servo-99cf9dbfc107bacb84dfe5afa9539a0ede3beac2.zip
auto merge of #5256 : servo/servo/rustup_20150311, r=jdm
...v. Relies on: * https://github.com/servo/rust-geom/pull/72 * https://github.com/servo/rust-glx/pull/10 * https://github.com/servo/gleam/pull/15 * https://github.com/servo/rust-mozjs/pull/137 * https://github.com/servo/rust-core-text/pull/35 * https://github.com/servo/rust-io-surface/pull/28
Diffstat (limited to 'components/util/task.rs')
-rw-r--r--components/util/task.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/util/task.rs b/components/util/task.rs
index d59d6233860..88acbd65e09 100644
--- a/components/util/task.rs
+++ b/components/util/task.rs
@@ -9,7 +9,7 @@ use std::sync::mpsc::Sender;
use std::thread::Builder;
pub fn spawn_named<F>(name: String, f: F)
- where F: FnOnce() + Send
+ where F: FnOnce() + Send + 'static
{
let builder = thread::Builder::new().name(name);
builder.spawn(move || {
@@ -23,13 +23,13 @@ pub fn spawn_named_with_send_on_failure<F, T>(name: &'static str,
f: F,
msg: T,
dest: Sender<T>)
- where F: FnOnce() + Send,
- T: Send
+ where F: FnOnce() + Send + 'static,
+ T: Send + 'static
{
- let future_handle = thread::Builder::new().name(name.to_owned()).scoped(move || {
+ let future_handle = thread::Builder::new().name(name.to_owned()).spawn(move || {
task_state::initialize(state);
f()
- });
+ }).unwrap();
let watcher_name = format!("{}Watcher", name);
Builder::new().name(watcher_name).spawn(move || {