about summary refs log tree commit diff
path: root/src/libstd/task.rs
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-12-06 18:34:37 -0800
committerAaron Turon <aturon@mozilla.com>2014-12-18 23:31:51 -0800
commit43ae4b3301cc0605839778ecf59effb32b752e33 (patch)
treeaa111f5adc1eaa1e996847e1437d1b1b40821ce0 /src/libstd/task.rs
parent14c1a103bc3f78721df1dc860a75a477c8275e3a (diff)
downloadrust-43ae4b3301cc0605839778ecf59effb32b752e33.tar.gz
rust-43ae4b3301cc0605839778ecf59effb32b752e33.zip
Fallout from new thread API
Diffstat (limited to 'src/libstd/task.rs')
-rw-r--r--src/libstd/task.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstd/task.rs b/src/libstd/task.rs
index 6881a1adb25..13395fc9c76 100644
--- a/src/libstd/task.rs
+++ b/src/libstd/task.rs
@@ -12,8 +12,11 @@
 
 #![deprecated = "use std::thread instead"]
 
+use any::Any;
+use boxed::Box;
 use thread;
 use kinds::Send;
+use result::Result;
 
 /// Deprecate: use `std::thread::Cfg` instead.
 #[deprecated = "use std::thread::Cfg instead"]
@@ -24,3 +27,15 @@ pub type TaskBuilder = thread::Cfg;
 pub fn spawn(f: proc(): Send) {
     thread::Thread::spawn(f);
 }
+
+/// Deprecated: use `std::thread::Thread::with_join instead`.
+#[deprecated = "use std::thread::Thread::with_join instead"]
+pub fn try<T: Send>(f: proc(): Send -> T) -> Result<T, Box<Any + Send>> {
+    thread::Thread::with_join(f).join()
+}
+
+/// Deprecated: use `std::thread::Thread::yield_now instead`.
+#[deprecated = "use std::thread::Thread::yield_now instead"]
+pub fn deschedule() {
+    thread::Thread::yield_now()
+}