Skip to content

Commit 11f71ec

Browse files
committed
Implement Sync/Send for windows' UnixStream
1 parent f5d619c commit 11f71ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libstd/sys/windows/pipe.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ pub struct UnixStream {
214214
write_deadline: u64,
215215
}
216216

217+
unsafe impl Send for UnixStream {}
218+
unsafe impl Sync for UnixStream {}
219+
217220
impl UnixStream {
218221
fn try_connect(p: *const u16) -> Option<libc::HANDLE> {
219222
// Note that most of this is lifted from the libuv implementation.
@@ -559,6 +562,7 @@ pub struct UnixListener {
559562
name: CString,
560563
}
561564

565+
unsafe impl Send for UnixListener {}
562566
unsafe impl Sync for UnixListener {}
563567

564568
impl UnixListener {
@@ -605,13 +609,15 @@ pub struct UnixAcceptor {
605609
deadline: u64,
606610
}
607611

612+
unsafe impl Send for UnixAcceptor {}
608613
unsafe impl Sync for UnixAcceptor {}
609614

610615
struct AcceptorState {
611616
abort: Event,
612617
closed: atomic::AtomicBool,
613618
}
614619

620+
unsafe impl Send for AcceptorState {}
615621
unsafe impl Sync for AcceptorState {}
616622

617623
impl UnixAcceptor {

0 commit comments

Comments
 (0)