]> git.lizzy.rs Git - rust.git/commitdiff
Implement Sync/Send for windows' UnixStream
authorFlavio Percoco <flaper87@gmail.com>
Sat, 27 Dec 2014 10:02:47 +0000 (11:02 +0100)
committerFlavio Percoco <flaper87@gmail.com>
Sat, 27 Dec 2014 11:40:25 +0000 (12:40 +0100)
src/libstd/sys/windows/pipe.rs

index 11226f53e17713b2c8600f5543e9886476207a85..fc3640f260437b8d1f72a1eb1f5ccb6cbbe2add7 100644 (file)
@@ -214,6 +214,9 @@ pub struct UnixStream {
     write_deadline: u64,
 }
 
+unsafe impl Send for UnixStream {}
+unsafe impl Sync for UnixStream {}
+
 impl UnixStream {
     fn try_connect(p: *const u16) -> Option<libc::HANDLE> {
         // Note that most of this is lifted from the libuv implementation.
@@ -559,6 +562,7 @@ pub struct UnixListener {
     name: CString,
 }
 
+unsafe impl Send for UnixListener {}
 unsafe impl Sync for UnixListener {}
 
 impl UnixListener {
@@ -605,6 +609,7 @@ pub struct UnixAcceptor {
     deadline: u64,
 }
 
+unsafe impl Send for UnixAcceptor {}
 unsafe impl Sync for UnixAcceptor {}
 
 struct AcceptorState {
@@ -612,6 +617,7 @@ struct AcceptorState {
     closed: atomic::AtomicBool,
 }
 
+unsafe impl Send for AcceptorState {}
 unsafe impl Sync for AcceptorState {}
 
 impl UnixAcceptor {