about summary refs log tree commit diff
path: root/src/libstd/thread.rs
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-12-22 00:49:42 +0100
committerFlavio Percoco <flaper87@gmail.com>2014-12-26 17:26:33 +0100
commitf436f9ca2963e33cc41802370bb9c551c833970e (patch)
treec79b09c0cb3024b389027fd2a501a44a0a1f9bb9 /src/libstd/thread.rs
parent686ce664da31f87b8d1c7377313f160d8fdcebe9 (diff)
downloadrust-f436f9ca2963e33cc41802370bb9c551c833970e.tar.gz
rust-f436f9ca2963e33cc41802370bb9c551c833970e.zip
Make Send and Sync traits unsafe
Diffstat (limited to 'src/libstd/thread.rs')
-rw-r--r--src/libstd/thread.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs
index e3b97afb31d..92aa5201ec3 100644
--- a/src/libstd/thread.rs
+++ b/src/libstd/thread.rs
@@ -283,19 +283,22 @@ impl Builder {
     }
 }
 
-#[deriving(Sync)]
 struct Inner {
     name: Option<String>,
     lock: Mutex<bool>,          // true when there is a buffered unpark
     cvar: Condvar,
 }
 
-#[deriving(Clone, Sync)]
+unsafe impl Sync for Inner {}
+
+#[deriving(Clone)]
 /// A handle to a thread.
 pub struct Thread {
     inner: Arc<Inner>,
 }
 
+unsafe impl Sync for Thread {}
+
 impl Thread {
     // Used only internally to construct a thread object without spawning
     fn new(name: Option<String>) -> Thread {