Skip to content

Commit fde4472

Browse files
committed
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 {}
1 parent fff5600 commit fde4472

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/libstd/sys/windows/tcp.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,13 @@ pub struct TcpAcceptor {
116116
deadline: u64,
117117
}
118118

119-
unsafe impl Send for TcpAcceptor {}
120-
unsafe impl Sync for TcpAcceptor {}
121-
122119
struct AcceptorInner {
123120
listener: TcpListener,
124121
abort: Event,
125122
accept: Event,
126123
closed: AtomicBool,
127124
}
128125

129-
unsafe impl Send for AcceptorInner {}
130126
unsafe impl Sync for AcceptorInner {}
131127

132128
impl TcpAcceptor {

0 commit comments

Comments
 (0)