diff options
Diffstat (limited to 'src/libstd/sys/unix/pipe.rs')
| -rw-r--r-- | src/libstd/sys/unix/pipe.rs | 10 | 
1 files changed, 3 insertions, 7 deletions
| diff --git a/src/libstd/sys/unix/pipe.rs b/src/libstd/sys/unix/pipe.rs index 868b460aa5e..1e1b95ee96c 100644 --- a/src/libstd/sys/unix/pipe.rs +++ b/src/libstd/sys/unix/pipe.rs @@ -8,13 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use prelude::*; + use alloc::arc::Arc; use libc; use c_str::CString; use mem; use sync::{atomic, Mutex}; use io::{mod, IoResult, IoError}; -use prelude::*; use sys::{mod, timer, retry, c, set_nonblocking, wouldblock}; use sys::fs::{fd_t, FileDesc}; @@ -117,9 +118,6 @@ pub struct UnixStream { write_deadline: u64, } -unsafe impl Send for UnixStream {} -unsafe impl Sync for UnixStream {} - impl UnixStream { pub fn connect(addr: &CString, timeout: Option<u64>) -> IoResult<UnixStream> { @@ -218,6 +216,7 @@ pub struct UnixListener { path: CString, } +// we currently own the CString, so these impls should be safe unsafe impl Send for UnixListener {} unsafe impl Sync for UnixListener {} @@ -265,9 +264,6 @@ struct AcceptorInner { closed: atomic::AtomicBool, } -unsafe impl Send for AcceptorInner {} -unsafe impl Sync for AcceptorInner {} - impl UnixAcceptor { pub fn fd(&self) -> fd_t { self.inner.listener.fd() } | 
