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 {}
This commit is contained in:
Flavio Percoco 2015-01-26 00:06:12 +01:00
parent fff5600925
commit fde4472848

View File

@ -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 {