diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2014-12-22 00:49:42 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2014-12-26 17:26:33 +0100 |
| commit | f436f9ca2963e33cc41802370bb9c551c833970e (patch) | |
| tree | c79b09c0cb3024b389027fd2a501a44a0a1f9bb9 /src/libstd/sys/common | |
| parent | 686ce664da31f87b8d1c7377313f160d8fdcebe9 (diff) | |
| download | rust-f436f9ca2963e33cc41802370bb9c551c833970e.tar.gz rust-f436f9ca2963e33cc41802370bb9c551c833970e.zip | |
Make Send and Sync traits unsafe
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/helper_thread.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/common/mutex.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs index 9df69d8e0d6..b0137bdad06 100644 --- a/src/libstd/sys/common/helper_thread.rs +++ b/src/libstd/sys/common/helper_thread.rs @@ -59,9 +59,9 @@ pub struct Helper<M> { pub shutdown: UnsafeCell<bool>, } -impl<M:Send> Send for Helper<M> { } +unsafe impl<M:Send> Send for Helper<M> { } -impl<M:Send> Sync for Helper<M> { } +unsafe impl<M:Send> Sync for Helper<M> { } impl<M: Send> Helper<M> { /// Lazily boots a helper thread, becoming a no-op if the helper has already diff --git a/src/libstd/sys/common/mutex.rs b/src/libstd/sys/common/mutex.rs index 5869c280517..567c26956ef 100644 --- a/src/libstd/sys/common/mutex.rs +++ b/src/libstd/sys/common/mutex.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use kinds::Sync; use sys::mutex as imp; /// An OS-based mutual exclusion lock. @@ -15,9 +16,10 @@ use sys::mutex as imp; /// This is the thinnest cross-platform wrapper around OS mutexes. All usage of /// this mutex is unsafe and it is recommended to instead use the safe wrapper /// at the top level of the crate instead of this type. -#[deriving(Sync)] pub struct Mutex(imp::Mutex); +unsafe impl Sync for Mutex {} + /// Constant initializer for statically allocated mutexes. pub const MUTEX_INIT: Mutex = Mutex(imp::MUTEX_INIT); |
