aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/thread.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/util/thread.rs')
-rw-r--r--components/util/thread.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/components/util/thread.rs b/components/util/thread.rs
index 87d8954dcf9..571d3529d9f 100644
--- a/components/util/thread.rs
+++ b/components/util/thread.rs
@@ -2,13 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use backtrace::Backtrace;
-use ipc_channel::ipc::IpcSender;
-use panicking;
-use serde::Serialize;
-use std::any::Any;
+#[cfg(feature = "servo")] use backtrace::Backtrace;
+#[cfg(feature = "servo")] use ipc_channel::ipc::IpcSender;
+#[cfg(feature = "servo")] use panicking;
+#[cfg(feature = "servo")] use serde::Serialize;
+#[cfg(feature = "servo")] use std::any::Any;
+#[cfg(feature = "servo")] use thread_state;
use std::thread;
-use thread_state;
pub fn spawn_named<F>(name: String, f: F)
where F: FnOnce() + Send + 'static
@@ -17,6 +17,7 @@ pub fn spawn_named<F>(name: String, f: F)
}
/// Arrange to send a particular message to a channel if the thread fails.
+#[cfg(feature = "servo")]
pub fn spawn_named_with_send_on_panic<F, Id>(name: String,
state: thread_state::ThreadState,
f: F,