Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/libstd/sys/windows/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ impl Drop for Event {
}
}

unsafe impl Send for Event {}
unsafe impl Sync for Event {}

struct Inner {
handle: libc::HANDLE,
lock: Mutex<()>,
Expand Down Expand Up @@ -156,6 +159,9 @@ impl Drop for Inner {
}
}

unsafe impl Send for Inner {}
unsafe impl Sync for Inner {}

unsafe fn pipe(name: *const u16, init: bool) -> libc::HANDLE {
libc::CreateNamedPipeW(
name,
Expand Down Expand Up @@ -220,9 +226,6 @@ 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.
Expand Down Expand Up @@ -615,17 +618,11 @@ pub struct UnixAcceptor {
deadline: u64,
}

unsafe impl Send for UnixAcceptor {}
unsafe impl Sync for UnixAcceptor {}

struct AcceptorState {
abort: Event,
closed: AtomicBool,
}

unsafe impl Send for AcceptorState {}
unsafe impl Sync for AcceptorState {}

impl UnixAcceptor {
pub fn accept(&mut self) -> IoResult<UnixStream> {
// This function has some funky implementation details when working with
Expand Down
4 changes: 0 additions & 4 deletions src/libstd/sys/windows/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,13 @@ pub struct TcpAcceptor {
deadline: u64,
}

unsafe impl Send for TcpAcceptor {}
unsafe impl Sync for TcpAcceptor {}

struct AcceptorInner {
listener: TcpListener,
abort: Event,
accept: Event,
closed: AtomicBool,
}

unsafe impl Send for AcceptorInner {}
unsafe impl Sync for AcceptorInner {}

impl TcpAcceptor {
Expand Down