summary refs log tree commit diff
path: root/src/libstd/sys/common
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-12-06 11:39:25 -0500
committerFlavio Percoco <flaper87@gmail.com>2014-12-26 17:26:32 +0100
commitfb803a857000813e4d572900799f0498fb20050b (patch)
treea1247d535c6dbb3fcaca0743cda7900481d14053 /src/libstd/sys/common
parentc43efee6def9a4a4e943feef0236d3e17b3f581d (diff)
downloadrust-fb803a857000813e4d572900799f0498fb20050b.tar.gz
rust-fb803a857000813e4d572900799f0498fb20050b.zip
Require types to opt-in Sync
Diffstat (limited to 'src/libstd/sys/common')
-rw-r--r--src/libstd/sys/common/helper_thread.rs4
-rw-r--r--src/libstd/sys/common/mutex.rs1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/sys/common/helper_thread.rs b/src/libstd/sys/common/helper_thread.rs
index 421778e2012..9df69d8e0d6 100644
--- a/src/libstd/sys/common/helper_thread.rs
+++ b/src/libstd/sys/common/helper_thread.rs
@@ -59,6 +59,10 @@ pub struct Helper<M> {
     pub shutdown: UnsafeCell<bool>,
 }
 
+impl<M:Send> Send for Helper<M> { }
+
+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
     /// been spawned.
diff --git a/src/libstd/sys/common/mutex.rs b/src/libstd/sys/common/mutex.rs
index 1a8a92a105a..5869c280517 100644
--- a/src/libstd/sys/common/mutex.rs
+++ b/src/libstd/sys/common/mutex.rs
@@ -15,6 +15,7 @@ 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);
 
 /// Constant initializer for statically allocated mutexes.