From fde4472848b662a4d1236388c4cf15e2450237e6 Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Mon, 26 Jan 2015 00:06:12 +0100 Subject: [PATCH] Make Unix and Windows impls consistent There are some explicit Send/Sync implementations for Window's types that don't exist in Unix. While the end result will be the same, I believe it's clearer if we keep the explicit implementations consistent by making the os-specific types Send/Sync where needed and possible. This commit addresses tcp. Existing differences below: src/libstd/sys/unix/tcp.rs unsafe impl Sync for TcpListener {} unsafe impl Sync for AcceptorInner {} src/libstd/sys/windows/tcp.rs unsafe impl Send for Event {} unsafe impl Sync for Event {} unsafe impl Send for TcpListener {} unsafe impl Sync for TcpListener {} unsafe impl Send for TcpAcceptor {} unsafe impl Sync for TcpAcceptor {} unsafe impl Send for AcceptorInner {} unsafe impl Sync for AcceptorInner {} --- src/libstd/sys/windows/tcp.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libstd/sys/windows/tcp.rs b/src/libstd/sys/windows/tcp.rs index 77139b52efa..ebebeb1a8a5 100644 --- a/src/libstd/sys/windows/tcp.rs +++ b/src/libstd/sys/windows/tcp.rs @@ -116,9 +116,6 @@ pub struct TcpAcceptor { deadline: u64, } -unsafe impl Send for TcpAcceptor {} -unsafe impl Sync for TcpAcceptor {} - struct AcceptorInner { listener: TcpListener, abort: Event, @@ -126,7 +123,6 @@ struct AcceptorInner { closed: AtomicBool, } -unsafe impl Send for AcceptorInner {} unsafe impl Sync for AcceptorInner {} impl TcpAcceptor {