Skip to content

Commit 51d2fef

Browse files
committed
Implement Sync for some windows sys types
1 parent e2116c8 commit 51d2fef

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/libstd/sys/windows/mutex.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ pub struct Mutex { inner: atomic::AtomicUint }
2222

2323
pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::INIT_ATOMIC_UINT };
2424

25+
unsafe impl Sync for Mutex {}
26+
2527
#[inline]
2628
pub unsafe fn raw(m: &Mutex) -> ffi::LPCRITICAL_SECTION {
2729
m.get()

src/libstd/sys/windows/pipe.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ pub struct UnixListener {
559559
name: CString,
560560
}
561561

562+
unsafe impl Sync for UnixListener {}
563+
562564
impl UnixListener {
563565
pub fn bind(addr: &CString) -> IoResult<UnixListener> {
564566
// Although we technically don't need the pipe until much later, we
@@ -603,11 +605,15 @@ pub struct UnixAcceptor {
603605
deadline: u64,
604606
}
605607

608+
unsafe impl Sync for UnixAcceptor {}
609+
606610
struct AcceptorState {
607611
abort: Event,
608612
closed: atomic::AtomicBool,
609613
}
610614

615+
unsafe impl Sync for AcceptorState {}
616+
611617
impl UnixAcceptor {
612618
pub fn accept(&mut self) -> IoResult<UnixStream> {
613619
// This function has some funky implementation details when working with

0 commit comments

Comments
 (0)