about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-12-22 17:15:51 +0100
committerFlavio Percoco <flaper87@gmail.com>2014-12-26 17:26:33 +0100
commit88186934960dae4f616df815eb25205c2713f503 (patch)
tree10568b070d36a957f6a6aacf726d3dae05f73354 /src/libstd/sync
parent7df17a2868004597bff61348060f423ad2384e04 (diff)
Relax `Arc` bounds don't require Sync+Send
Besides the above making sense, it'll also allow us to make `RacyCell`
private and use UnsafeCell instead.
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/mutex.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index 77c358c6259..fbbbb3e77a4 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -10,7 +10,6 @@
 
 use prelude::*;
 
-use comm::RacyCell;
 use cell::UnsafeCell;
 use kinds::marker;
 use sync::{poison, AsMutexGuard};
@@ -71,7 +70,7 @@ pub struct Mutex<T> {
     // time, so to ensure that the native mutex is used correctly we box the
     // inner lock to give it a constant address.
     inner: Box<StaticMutex>,
-    data: RacyCell<T>,
+    data: UnsafeCell<T>,
 }
 
 unsafe impl<T:Send> Send for Mutex<T> { }
@@ -101,7 +100,7 @@ unsafe impl<T:Send> Sync for Mutex<T> { }
 /// ```
 pub struct StaticMutex {
     lock: sys::Mutex,
-    poison: RacyCell<poison::Flag>,
+    poison: UnsafeCell<poison::Flag>,
 }
 
 unsafe impl Sync for StaticMutex {}
@@ -132,7 +131,7 @@ pub struct StaticMutexGuard {
 /// other mutex constants.
 pub const MUTEX_INIT: StaticMutex = StaticMutex {
     lock: sys::MUTEX_INIT,
-    poison: RacyCell(UnsafeCell { value: poison::Flag { failed: false } }),
+    poison: UnsafeCell { value: poison::Flag { failed: false } },
 };
 
 impl<T: Send> Mutex<T> {
@@ -140,7 +139,7 @@ impl<T: Send> Mutex<T> {
     pub fn new(t: T) -> Mutex<T> {
         Mutex {
             inner: box MUTEX_INIT,
-            data: RacyCell::new(t),
+            data: UnsafeCell::new(t),
         }
     }