about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/liballoc/arc.rs4
-rw-r--r--src/test/run-pass/spawn-fn.rs16
2 files changed, 9 insertions, 11 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index f3b72e4a9ee..338d7e33631 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -33,7 +33,7 @@
 //!
 //! Sharing some immutable data between tasks:
 //!
-//! ```
+//! ```no_run
 //! use std::sync::Arc;
 //! use std::thread;
 //!
@@ -50,7 +50,7 @@
 //!
 //! Sharing mutable data safely between tasks with a `Mutex`:
 //!
-//! ```
+//! ```no_run
 //! use std::sync::{Arc, Mutex};
 //! use std::thread;
 //!
diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs
index 4f8ba7f655e..efddf0455cd 100644
--- a/src/test/run-pass/spawn-fn.rs
+++ b/src/test/run-pass/spawn-fn.rs
@@ -8,23 +8,21 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(std_misc)]
+use std::thread;
 
-use std::thread::Thread;
-
-fn x(s: String, n: int) {
+fn x(s: String, n: isize) {
     println!("{}", s);
     println!("{}", n);
 }
 
 pub fn main() {
-    let _t = Thread::spawn(|| x("hello from first spawned fn".to_string(), 65) );
-    let _t = Thread::spawn(|| x("hello from second spawned fn".to_string(), 66) );
-    let _t = Thread::spawn(|| x("hello from third spawned fn".to_string(), 67) );
-    let mut i: int = 30;
+    let _t = thread::scoped(|| x("hello from first spawned fn".to_string(), 65) );
+    let _t = thread::scoped(|| x("hello from second spawned fn".to_string(), 66) );
+    let _t = thread::scoped(|| x("hello from third spawned fn".to_string(), 67) );
+    let mut i = 30;
     while i > 0 {
         i = i - 1;
         println!("parent sleeping");
-        Thread::yield_now();
+        thread::yield_now();
     }
 }