about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-21 03:41:45 +0000
committerbors <bors@rust-lang.org>2014-11-21 03:41:45 +0000
commitc9f6d696420107f82304b992cf623b806995fe18 (patch)
treed2224bd566aaf93132fb5a959e0ba33192bde035 /src/libstd/sys
parent98300516072c6afd0e93654b325f5924b60dea53 (diff)
parent32c3d027801b8f30f741b1b5340682e7009d02ac (diff)
downloadrust-c9f6d696420107f82304b992cf623b806995fe18.tar.gz
rust-c9f6d696420107f82304b992cf623b806995fe18.zip
auto merge of #18967 : aturon/rust/remove-runtime, r=alexcrichton
This PR completes the removal of the runtime system and green-threaded abstractions as part of implementing [RFC 230](https://github.com/rust-lang/rfcs/pull/230).

Specifically:

* It removes the `Runtime` trait, welding the scheduling infrastructure directly to native threads.

* It removes `libgreen` and `libnative` entirely.

* It rewrites `sync::mutex` as a trivial layer on top of native mutexes. Eventually, the two modules will be merged.

* It hides the vast majority of `std::rt`.

This completes the basic task of removing the runtime system (I/O and scheduling) and components that depend on it. 

After this lands, a follow-up PR will pull the `rustrt` crate back into `std`, turn `std::task` into `std::thread` (with API changes to go along with it), and completely cut out the remaining startup/teardown sequence. Other changes, including new [TLS](https://github.com/rust-lang/rfcs/pull/461) and synchronization are in the RFC or pre-RFC phase.

Closes #17325
Closes #18687

[breaking-change]

r? @alexcrichton 
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/helper_thread.rs8
-rw-r--r--src/libstd/sys/common/net.rs2
-rw-r--r--src/libstd/sys/unix/mod.rs2
-rw-r--r--src/libstd/sys/unix/pipe.rs2
-rw-r--r--src/libstd/sys/windows/mod.rs2
-rw-r--r--src/libstd/sys/windows/pipe.rs2
6 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs
index 87907fde277..9508d8d9232 100644
--- a/src/libstd/sys/common/helper_thread.rs
+++ b/src/libstd/sys/common/helper_thread.rs
@@ -21,9 +21,9 @@
 //! time.
 
 use mem;
-use rt::bookkeeping;
-use rt::mutex::StaticNativeMutex;
-use rt;
+use rustrt::bookkeeping;
+use rustrt::mutex::StaticNativeMutex;
+use rustrt;
 use cell::UnsafeCell;
 use sys::helper_signal;
 use prelude::*;
@@ -83,7 +83,7 @@ impl<M: Send> Helper<M> {
                     self.lock.lock().signal()
                 });
 
-                rt::at_exit(proc() { self.shutdown() });
+                rustrt::at_exit(proc() { self.shutdown() });
                 *self.initialized.get() = true;
             }
         }
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs
index 9b2b594a9c7..029fc852742 100644
--- a/src/libstd/sys/common/net.rs
+++ b/src/libstd/sys/common/net.rs
@@ -16,7 +16,7 @@ use libc::{mod, c_char, c_int};
 use mem;
 use num::Int;
 use ptr::{mod, null, null_mut};
-use rt::mutex;
+use rustrt::mutex;
 use io::net::ip::{SocketAddr, IpAddr, Ipv4Addr, Ipv6Addr};
 use io::net::addrinfo;
 use io::{IoResult, IoError};
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index 4db9e8a9df8..664a6a1e70c 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -25,7 +25,7 @@ use sys_common::mkerr_libc;
 
 macro_rules! helper_init( (static $name:ident: Helper<$m:ty>) => (
     static $name: Helper<$m> = Helper {
-        lock: ::rt::mutex::NATIVE_MUTEX_INIT,
+        lock: ::rustrt::mutex::NATIVE_MUTEX_INIT,
         chan: ::cell::UnsafeCell { value: 0 as *mut Sender<$m> },
         signal: ::cell::UnsafeCell { value: 0 },
         initialized: ::cell::UnsafeCell { value: false },
diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs
index 3fba06e0c7f..4d3469a9c24 100644
--- a/src/libstd/sys/unix/pipe.rs
+++ b/src/libstd/sys/unix/pipe.rs
@@ -12,7 +12,7 @@ use alloc::arc::Arc;
 use libc;
 use c_str::CString;
 use mem;
-use rt::mutex;
+use rustrt::mutex;
 use sync::atomic;
 use io::{mod, IoResult, IoError};
 use prelude::*;
diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs
index f316b2d8493..815ace21f87 100644
--- a/src/libstd/sys/windows/mod.rs
+++ b/src/libstd/sys/windows/mod.rs
@@ -26,7 +26,7 @@ use sync::{Once, ONCE_INIT};
 
 macro_rules! helper_init( (static $name:ident: Helper<$m:ty>) => (
     static $name: Helper<$m> = Helper {
-        lock: ::rt::mutex::NATIVE_MUTEX_INIT,
+        lock: ::rustrt::mutex::NATIVE_MUTEX_INIT,
         chan: ::cell::UnsafeCell { value: 0 as *mut Sender<$m> },
         signal: ::cell::UnsafeCell { value: 0 },
         initialized: ::cell::UnsafeCell { value: false },
diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs
index e38202302fb..a623c2cd8e2 100644
--- a/src/libstd/sys/windows/pipe.rs
+++ b/src/libstd/sys/windows/pipe.rs
@@ -90,7 +90,7 @@ use c_str::CString;
 use mem;
 use ptr;
 use sync::atomic;
-use rt::mutex;
+use rustrt::mutex;
 use io::{mod, IoError, IoResult};
 use prelude::*;