about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-11 11:47:04 -0700
committerbors <bors@rust-lang.org>2014-06-11 11:47:04 -0700
commitf9260d41d6e37653bf71b08a041be0310098716a (patch)
tree4f94a53405884d3c29224585d2eac1d5242eb7d1 /src/libcore
parentf0f9095f1daa3814c9589f38b574e51d394d1bbc (diff)
parentb1c9ce9c6f0eb7d4a7df1aad6b6799f4b548181c (diff)
downloadrust-f9260d41d6e37653bf71b08a041be0310098716a.tar.gz
rust-f9260d41d6e37653bf71b08a041be0310098716a.zip
auto merge of #14746 : alexcrichton/rust/libsync, r=brson
This commit is the final step in the libstd facade, #13851. The purpose of this
commit is to move libsync underneath the standard library, behind the facade.
This will allow core primitives like channels, queues, and atomics to all live
in the same location.

There were a few notable changes and a few breaking changes as part of this
movement:

* The `Vec` and `String` types are reexported at the top level of libcollections
* The `unreachable!()` macro was copied to libcore
* The `std::rt::thread` module was moved to librustrt, but it is still
  reexported at the same location.
* The `std::comm` module was moved to libsync
* The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`.
  It is now a private module with types/functions being reexported under
  `sync::comm`. This is a breaking change for any existing users of duplex
  streams.
* All concurrent queues/deques were moved directly under libsync. They are also
  all marked with #![experimental] for now if they are public.
* The `task_pool` and `future` modules no longer live in libsync, but rather
  live under `std::sync`. They will forever live at this location, but they may
  move to libsync if the `std::task` module moves as well.

[breaking-change]
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/atomics.rs12
-rw-r--r--src/libcore/macros.rs3
2 files changed, 8 insertions, 7 deletions
diff --git a/src/libcore/atomics.rs b/src/libcore/atomics.rs
index 9edce3bd675..65ba11f89ad 100644
--- a/src/libcore/atomics.rs
+++ b/src/libcore/atomics.rs
@@ -121,16 +121,14 @@ impl AtomicBool {
     ///
     /// # Examples
     ///
-    /// ```ignore
-    /// # // FIXME: Needs PR #12430
-    /// extern crate sync;
-    ///
-    /// use sync::Arc;
+    /// ```rust
+    /// use std::sync::Arc;
     /// use std::sync::atomics::{AtomicBool, SeqCst};
+    /// use std::task::deschedule;
     ///
     /// fn main() {
     ///     let spinlock = Arc::new(AtomicBool::new(false));
-    ///     let spinlock_clone = spin_lock.clone();
+    ///     let spinlock_clone = spinlock.clone();
     ///
     ///     spawn(proc() {
     ///         with_lock(&spinlock, || println!("task 1 in lock"));
@@ -155,7 +153,7 @@ impl AtomicBool {
     ///     f();
     ///
     ///     // Release the lock
-    ///     spinlock.store(false);
+    ///     spinlock.store(false, SeqCst);
     /// }
     /// ```
     #[inline]
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 7942a1569ed..a62bc10d8ab 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -131,3 +131,6 @@ macro_rules! write(
         format_args_method!($dst, write_fmt, $($arg)*)
     })
 )
+
+#[macro_export]
+macro_rules! unreachable( () => (fail!("unreachable code")) )