mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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)
This commit is contained in:
parent
9e94ecf99c
commit
6df1cc8e4c
14 changed files with 48 additions and 36 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue