]> git.lizzy.rs Git - rust.git/commitdiff
Fallout from new termination semantics
authorAaron Turon <aturon@mozilla.com>
Sat, 15 Nov 2014 07:05:37 +0000 (23:05 -0800)
committerAaron Turon <aturon@mozilla.com>
Fri, 21 Nov 2014 01:19:24 +0000 (17:19 -0800)
src/librustrt/local.rs
src/librustrt/mutex.rs
src/librustrt/task.rs
src/test/run-pass/out-of-stack-new-thread-no-split.rs
src/test/run-pass/process-spawn-with-unicode-params.rs

index 93c5508e0426f4f521902367717ec71981a14645..b1d387a9cc358239d02342c62b296585d78244d4 100644 (file)
@@ -52,17 +52,15 @@ unsafe fn try_unsafe_borrow() -> Option<*mut Task> {
 
 #[cfg(test)]
 mod test {
-    extern crate rustrt;
-
     use std::prelude::*;
-    use rustrt::thread::Thread;
+    use thread::Thread;
     use super::*;
     use task::Task;
 
     #[test]
     fn thread_local_task_smoke_test() {
         Thread::start(proc() {
-            let task = box Task::new();
+            let task = box Task::new(None, None);
             Local::put(task);
             let task: Box<Task> = Local::take();
             cleanup_task(task);
@@ -72,11 +70,11 @@ fn thread_local_task_smoke_test() {
     #[test]
     fn thread_local_task_two_instances() {
         Thread::start(proc() {
-            let task = box Task::new();
+            let task = box Task::new(None, None);
             Local::put(task);
             let task: Box<Task> = Local::take();
             cleanup_task(task);
-            let task = box Task::new();
+            let task = box Task::new(None, None);
             Local::put(task);
             let task: Box<Task> = Local::take();
             cleanup_task(task);
@@ -86,7 +84,7 @@ fn thread_local_task_two_instances() {
     #[test]
     fn borrow_smoke_test() {
         Thread::start(proc() {
-            let task = box Task::new();
+            let task = box Task::new(None, None);
             Local::put(task);
 
             unsafe {
@@ -100,7 +98,7 @@ fn borrow_smoke_test() {
     #[test]
     fn borrow_with_return() {
         Thread::start(proc() {
-            let task = box Task::new();
+            let task = box Task::new(None, None);
             Local::put(task);
 
             {
@@ -115,7 +113,7 @@ fn borrow_with_return() {
     #[test]
     fn try_take() {
         Thread::start(proc() {
-            let task = box Task::new();
+            let task = box Task::new(None, None);
             Local::put(task);
 
             let t: Box<Task> = Local::try_take().unwrap();
index 11f601593632920bb72a5e3432a6277facbb1037..2f0daf8f6e2429a073bc7d4d1c7794e5a1a2ea39 100644 (file)
@@ -649,13 +649,11 @@ fn InitializeCriticalSectionAndSpinCount(
 
 #[cfg(test)]
 mod test {
-    extern crate rustrt;
-
     use std::prelude::*;
 
     use std::mem::drop;
     use super::{StaticNativeMutex, NATIVE_MUTEX_INIT};
-    use rustrt::thread::Thread;
+    use thread::Thread;
 
     #[test]
     fn smoke_lock() {
index cec28a464f8b1e01e9df3d356215ce008d92b31f..64c402bfbbc3985c8293205f169629c3b9a755c7 100644 (file)
@@ -544,11 +544,10 @@ pub fn new() -> Death {
 
 #[cfg(test)]
 mod test {
-    extern crate rustrt;
-
     use super::*;
     use std::prelude::*;
     use std::task;
+    use unwind;
 
     #[test]
     fn tls() {
@@ -594,20 +593,20 @@ fn comm_shared_chan() {
     #[test]
     #[should_fail]
     fn test_begin_unwind() {
-        use rustrt::unwind::begin_unwind;
+        use unwind::begin_unwind;
         begin_unwind("cause", &(file!(), line!()))
     }
 
     #[test]
     fn drop_new_task_ok() {
-        drop(Task::new());
+        drop(Task::new(None, None));
     }
 
     // Task blocking tests
 
     #[test]
     fn block_and_wake() {
-        let task = box Task::new();
+        let task = box Task::new(None, None);
         let task = BlockedTask::block(task).wake().unwrap();
         task.drop();
     }
index e4a4216132214271f5698556e85c519e9e54a189..21847a486d949f574fb87f7781e84abd5adb78c4 100644 (file)
@@ -36,9 +36,12 @@ fn main() {
     let args = os::args();
     let args = args.as_slice();
     if args.len() > 1 && args[1].as_slice() == "recurse" {
+        let (tx, rx) = channel();
         spawn(proc() {
             recurse();
+            tx.send(());
         });
+        rx.recv();
     } else {
         let recurse = Command::new(args[0].as_slice()).arg("recurse").output().unwrap();
         assert!(!recurse.status.success());
index 1c24210d6cd98f789fc60cc7d7842350097aacf4..cceb0bf4d96e832d8de6a2f22d8d447370e96caf 100644 (file)
@@ -16,8 +16,6 @@
 // non-ASCII characters.  The child process ensures all the strings are
 // intact.
 
-extern crate native;
-
 use std::io;
 use std::io::fs;
 use std::io::Command;