about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-12-22 14:13:24 +0100
committerFlavio Percoco <flaper87@gmail.com>2014-12-26 17:26:33 +0100
commit51d2fefd91bbbfa8572d30f9bd4374fe53514cd9 (patch)
treeee9535124061bb975a58721d88ce5889c20f9f29 /src/libstd
parente2116c8fba6e73bc2bbf7cb6bb41911d4daed043 (diff)
downloadrust-51d2fefd91bbbfa8572d30f9bd4374fe53514cd9.tar.gz
rust-51d2fefd91bbbfa8572d30f9bd4374fe53514cd9.zip
Implement `Sync` for some windows sys types
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/windows/mutex.rs2
-rw-r--r--src/libstd/sys/windows/pipe.rs6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/mutex.rs b/src/libstd/sys/windows/mutex.rs
index ddd89070ed5..3ac7c09154e 100644
--- a/src/libstd/sys/windows/mutex.rs
+++ b/src/libstd/sys/windows/mutex.rs
@@ -22,6 +22,8 @@ pub struct Mutex { inner: atomic::AtomicUint }
 
 pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::INIT_ATOMIC_UINT };
 
+unsafe impl Sync for Mutex {}
+
 #[inline]
 pub unsafe fn raw(m: &Mutex) -> ffi::LPCRITICAL_SECTION {
     m.get()
diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs
index bf658d0efd0..11226f53e17 100644
--- a/src/libstd/sys/windows/pipe.rs
+++ b/src/libstd/sys/windows/pipe.rs
@@ -559,6 +559,8 @@ pub struct UnixListener {
     name: CString,
 }
 
+unsafe impl Sync for UnixListener {}
+
 impl UnixListener {
     pub fn bind(addr: &CString) -> IoResult<UnixListener> {
         // Although we technically don't need the pipe until much later, we
@@ -603,11 +605,15 @@ pub struct UnixAcceptor {
     deadline: u64,
 }
 
+unsafe impl Sync for UnixAcceptor {}
+
 struct AcceptorState {
     abort: Event,
     closed: atomic::AtomicBool,
 }
 
+unsafe impl Sync for AcceptorState {}
+
 impl UnixAcceptor {
     pub fn accept(&mut self) -> IoResult<UnixStream> {
         // This function has some funky implementation details when working with