Implement Sync/Send for windows' UnixStream

This commit is contained in:
Flavio Percoco 2014-12-27 11:02:47 +01:00
parent f5d619caf9
commit 11f71ec701
1 changed files with 6 additions and 0 deletions

View File

@ -214,6 +214,9 @@ 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.
@ -559,6 +562,7 @@ pub struct UnixListener {
name: CString,
}
unsafe impl Send for UnixListener {}
unsafe impl Sync for UnixListener {}
impl UnixListener {
@ -605,6 +609,7 @@ pub struct UnixAcceptor {
deadline: u64,
}
unsafe impl Send for UnixAcceptor {}
unsafe impl Sync for UnixAcceptor {}
struct AcceptorState {
@ -612,6 +617,7 @@ struct AcceptorState {
closed: atomic::AtomicBool,
}
unsafe impl Send for AcceptorState {}
unsafe impl Sync for AcceptorState {}
impl UnixAcceptor {