about summary refs log tree commit diff
path: root/src/libstd/sys/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sys/common')
-rw-r--r--src/libstd/sys/common/backtrace.rs2
-rw-r--r--src/libstd/sys/common/helper_thread.rs6
-rw-r--r--src/libstd/sys/common/mod.rs1
-rw-r--r--src/libstd/sys/common/thread_info.rs15
-rw-r--r--src/libstd/sys/common/thread_local.rs1
5 files changed, 13 insertions, 12 deletions
diff --git a/src/libstd/sys/common/backtrace.rs b/src/libstd/sys/common/backtrace.rs
index 0c03060b314..38dc516bf3d 100644
--- a/src/libstd/sys/common/backtrace.rs
+++ b/src/libstd/sys/common/backtrace.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use io::{IoResult, Writer};
-use iter::Iterator;
+use iter::{Iterator, IteratorExt};
 use option::{Some, None};
 use result::{Ok, Err};
 use str::{StrPrelude, from_str};
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs
index ef0181b72b0..8aa09d9bd30 100644
--- a/src/libstd/sys/common/helper_thread.rs
+++ b/src/libstd/sys/common/helper_thread.rs
@@ -28,7 +28,7 @@ use sync::{StaticMutex, StaticCondvar};
 use rt;
 use sys::helper_signal;
 
-use task;
+use thread::Thread;
 
 /// A structure for management of a helper thread.
 ///
@@ -82,7 +82,11 @@ impl<M: Send> Helper<M> {
                 *self.signal.get() = send as uint;
 
                 let t = f();
+<<<<<<< HEAD
                 task::spawn(move |:| {
+=======
+                Thread::spawn(proc() {
+>>>>>>> Fallout from new thread API
                     helper(receive, rx, t);
                     let _g = self.lock.lock();
                     *self.shutdown.get() = true;
diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs
index aeee4cf01cd..dc0ad08cdbe 100644
--- a/src/libstd/sys/common/mod.rs
+++ b/src/libstd/sys/common/mod.rs
@@ -27,6 +27,7 @@ pub mod net;
 pub mod rwlock;
 pub mod stack;
 pub mod thread;
+pub mod thread_info;
 pub mod thread_local;
 
 // common error constructors
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs
index f88fd49ab99..0612448cfa0 100644
--- a/src/libstd/sys/common/thread_info.rs
+++ b/src/libstd/sys/common/thread_info.rs
@@ -33,11 +33,11 @@ impl ThreadInfo {
                 *c.borrow_mut() = Some(ThreadInfo {
                     stack_bounds: (0, 0),
                     stack_guard: 0,
-                    unwinder: false,
-                    thread: Thread::new(None),
+                    unwinding: false,
+                    thread: NewThread::new(None),
                 })
             }
-            f(c.borrow_mut().as_ref().unwrap())
+            f(c.borrow_mut().as_mut().unwrap())
         })
     }
 }
@@ -47,28 +47,25 @@ pub fn current_thread() -> Thread {
 }
 
 pub fn panicking() -> bool {
-    ThreadInfo::with(|info| info.unwinder.unwinding())
+    ThreadInfo::with(|info| info.unwinding)
 }
 
 pub fn stack_guard() -> uint {
     ThreadInfo::with(|info| info.stack_guard)
 }
 
-pub fn unwinding() -> bool {
-    ThreadInfo::with(|info| info.unwinder.unwinding)
-}
-
 pub fn set_unwinding(unwinding: bool) {
     ThreadInfo::with(|info| info.unwinding = unwinding)
 }
 
 pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) {
     THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
+    let mut thread_opt = Some(thread); // option dance
     THREAD_INFO.with(|c| *c.borrow_mut() = Some(ThreadInfo{
         stack_bounds: stack_bounds,
         stack_guard: stack_guard,
         unwinding: false,
-        thread: thread,
+        thread: thread_opt.take().unwrap(),
     }));
 }
 
diff --git a/src/libstd/sys/common/thread_local.rs b/src/libstd/sys/common/thread_local.rs
index c3bf5cfc301..fe7a7d8d037 100644
--- a/src/libstd/sys/common/thread_local.rs
+++ b/src/libstd/sys/common/thread_local.rs
@@ -58,7 +58,6 @@
 
 use prelude::*;
 
-use rt;
 use sync::atomic::{mod, AtomicUint};
 use sync::{Mutex, Once, ONCE_INIT};