mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Remove dependencies on the native crate.
This commit is contained in:
parent
394508953e
commit
04eb923da9
11 changed files with 6 additions and 26 deletions
|
@ -6,7 +6,6 @@ use std::str::IntoMaybeOwned;
|
|||
use std::task;
|
||||
use std::comm::Sender;
|
||||
use std::task::TaskBuilder;
|
||||
use native::task::NativeTaskBuilder;
|
||||
use rtinstrument;
|
||||
use task_state;
|
||||
|
||||
|
@ -18,10 +17,7 @@ pub fn spawn_named<S: IntoMaybeOwned<'static>>(name: S, f: proc():Send) {
|
|||
}
|
||||
|
||||
pub fn spawn_named_native<S: IntoMaybeOwned<'static>>(name: S, f: proc():Send) {
|
||||
let builder = task::TaskBuilder::new().named(name).native();
|
||||
builder.spawn(proc() {
|
||||
rtinstrument::instrument(f);
|
||||
});
|
||||
spawn_named(name, f)
|
||||
}
|
||||
|
||||
/// Arrange to send a particular message to a channel if the task fails.
|
||||
|
@ -30,17 +26,11 @@ pub fn spawn_named_with_send_on_failure<T: Send>(name: &'static str,
|
|||
f: proc(): Send,
|
||||
msg: T,
|
||||
dest: Sender<T>,
|
||||
native: bool) {
|
||||
let with_state = proc() {
|
||||
_native: bool) {
|
||||
let future_result = TaskBuilder::new().named(name).try_future(proc() {
|
||||
task_state::initialize(state);
|
||||
rtinstrument::instrument(f);
|
||||
};
|
||||
|
||||
let future_result = if native {
|
||||
TaskBuilder::new().named(name).native().try_future(with_state)
|
||||
} else {
|
||||
TaskBuilder::new().named(name).try_future(with_state)
|
||||
};
|
||||
});
|
||||
|
||||
let watched_name = name.into_string();
|
||||
let watcher_name = format!("{}Watcher", watched_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue