1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Deprecated in favor of `thread`.
13 #![deprecated = "use std::thread instead"]
22 /// Deprecate: use `std::thread::Builder` instead.
23 #[deprecated = "use std::thread::Builder instead"]
24 pub type TaskBuilder = thread::Builder;
26 /// Deprecated: use `std::thread::Thread::spawn` and `detach` instead.
27 #[deprecated = "use std::thread::Thread::spawn and detach instead"]
28 pub fn spawn<F>(f: F) where F: FnOnce(), F: Send {
29 thread::Thread::spawn(f).detach();
32 /// Deprecated: use `std::thread::Thread::spawn` and `join` instead.
33 #[deprecated = "use std::thread::Thread::spawn and join instead"]
34 pub fn try<T, F>(f: F) -> Result<T, Box<Any + Send>> where
35 T: Send, F: FnOnce() -> T, F: Send
37 thread::Thread::spawn(f).join()
40 /// Deprecated: use `std::thread::Thread::yield_now instead`.
41 #[deprecated = "use std::thread::Thread::yield_now instead"]
43 thread::Thread::yield_now()