diff options
author | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-28 09:53:45 -0700 |
---|---|---|
committer | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-28 09:53:45 -0700 |
commit | 6df1cc8e4c1ed6c4a99435808f7e236eedaed0a1 (patch) | |
tree | dbf10231b9ceee58d3891d7ffab6840f5f561ab3 /components/util/task.rs | |
parent | 9e94ecf99cff7c57275ab39c7b11870e55756d63 (diff) | |
download | servo-6df1cc8e4c1ed6c4a99435808f7e236eedaed0a1.tar.gz servo-6df1cc8e4c1ed6c4a99435808f7e236eedaed0a1.zip |
Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a
central location, and util::task was the perfect place for it.
r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of
reviews today because I don't know who better to give them to)
Diffstat (limited to 'components/util/task.rs')
-rw-r--r-- | components/util/task.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/util/task.rs b/components/util/task.rs index f286efe5bc3..f38d87d0907 100644 --- a/components/util/task.rs +++ b/components/util/task.rs @@ -15,6 +15,11 @@ pub fn spawn_named<S: IntoMaybeOwned<'static>>(name: S, f: proc():Send) { builder.spawn(f); } +pub fn spawn_named_native<S: IntoMaybeOwned<'static>>(name: S, f: proc():Send) { + let builder = task::TaskBuilder::new().named(name).native(); + builder.spawn(f); +} + /// Arrange to send a particular message to a channel if the task fails. pub fn spawn_named_with_send_on_failure<T: Send>(name: &'static str, state: task_state::TaskState, |