Remove dependencies on the native crate.

This commit is contained in:
Ms2ger 2015-01-04 11:58:37 +01:00
parent 394508953e
commit 04eb923da9
11 changed files with 6 additions and 26 deletions

View file

@ -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);