mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 19:23:10 +00:00
Rollup merge of 21654 - FlaPer87:unify-impls, r=alexcrichton
This commit is contained in:
commit
2403176dde
@ -129,6 +129,9 @@ impl Drop for Event {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Event {}
|
||||
unsafe impl Sync for Event {}
|
||||
|
||||
struct Inner {
|
||||
handle: libc::HANDLE,
|
||||
lock: Mutex<()>,
|
||||
@ -156,6 +159,9 @@ impl Drop for Inner {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Inner {}
|
||||
unsafe impl Sync for Inner {}
|
||||
|
||||
unsafe fn pipe(name: *const u16, init: bool) -> libc::HANDLE {
|
||||
libc::CreateNamedPipeW(
|
||||
name,
|
||||
@ -220,9 +226,6 @@ pub struct UnixStream {
|
||||
write_deadline: u64,
|
||||
}
|
||||
|
||||
unsafe impl Send for UnixStream {}
|
||||
unsafe impl Sync for UnixStream {}
|
||||
|
||||
impl UnixStream {
|
||||
fn try_connect(p: *const u16) -> Option<libc::HANDLE> {
|
||||
// Note that most of this is lifted from the libuv implementation.
|
||||
@ -615,17 +618,11 @@ pub struct UnixAcceptor {
|
||||
deadline: u64,
|
||||
}
|
||||
|
||||
unsafe impl Send for UnixAcceptor {}
|
||||
unsafe impl Sync for UnixAcceptor {}
|
||||
|
||||
struct AcceptorState {
|
||||
abort: Event,
|
||||
closed: AtomicBool,
|
||||
}
|
||||
|
||||
unsafe impl Send for AcceptorState {}
|
||||
unsafe impl Sync for AcceptorState {}
|
||||
|
||||
impl UnixAcceptor {
|
||||
pub fn accept(&mut self) -> IoResult<UnixStream> {
|
||||
// This function has some funky implementation details when working with
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user