mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
Implement Sync
for some windows sys types
This commit is contained in:
parent
e2116c8fba
commit
51d2fefd91
@ -22,6 +22,8 @@ pub struct Mutex { inner: atomic::AtomicUint }
|
|||||||
|
|
||||||
pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::INIT_ATOMIC_UINT };
|
pub const MUTEX_INIT: Mutex = Mutex { inner: atomic::INIT_ATOMIC_UINT };
|
||||||
|
|
||||||
|
unsafe impl Sync for Mutex {}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn raw(m: &Mutex) -> ffi::LPCRITICAL_SECTION {
|
pub unsafe fn raw(m: &Mutex) -> ffi::LPCRITICAL_SECTION {
|
||||||
m.get()
|
m.get()
|
||||||
|
@ -559,6 +559,8 @@ pub struct UnixListener {
|
|||||||
name: CString,
|
name: CString,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Sync for UnixListener {}
|
||||||
|
|
||||||
impl UnixListener {
|
impl UnixListener {
|
||||||
pub fn bind(addr: &CString) -> IoResult<UnixListener> {
|
pub fn bind(addr: &CString) -> IoResult<UnixListener> {
|
||||||
// Although we technically don't need the pipe until much later, we
|
// Although we technically don't need the pipe until much later, we
|
||||||
@ -603,11 +605,15 @@ pub struct UnixAcceptor {
|
|||||||
deadline: u64,
|
deadline: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Sync for UnixAcceptor {}
|
||||||
|
|
||||||
struct AcceptorState {
|
struct AcceptorState {
|
||||||
abort: Event,
|
abort: Event,
|
||||||
closed: atomic::AtomicBool,
|
closed: atomic::AtomicBool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Sync for AcceptorState {}
|
||||||
|
|
||||||
impl UnixAcceptor {
|
impl UnixAcceptor {
|
||||||
pub fn accept(&mut self) -> IoResult<UnixStream> {
|
pub fn accept(&mut self) -> IoResult<UnixStream> {
|
||||||
// This function has some funky implementation details when working with
|
// This function has some funky implementation details when working with
|
||||||
|
Loading…
Reference in New Issue
Block a user