diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2014-12-06 11:39:25 -0500 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2014-12-26 17:26:32 +0100 |
| commit | fb803a857000813e4d572900799f0498fb20050b (patch) | |
| tree | a1247d535c6dbb3fcaca0743cda7900481d14053 /src/libstd/sys/common | |
| parent | c43efee6def9a4a4e943feef0236d3e17b3f581d (diff) | |
| download | rust-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.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/common/mutex.rs | 1 |
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. |
