File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ pub use sys_common::net::TcpStream;
2424
2525pub struct Event ( c:: WSAEVENT ) ;
2626
27+ unsafe impl Send for Event { }
28+ unsafe impl Sync for Event { }
29+
2730impl Event {
2831 pub fn new ( ) -> IoResult < Event > {
2932 let event = unsafe { c:: WSACreateEvent ( ) } ;
@@ -49,6 +52,9 @@ impl Drop for Event {
4952
5053pub struct TcpListener { sock : sock_t }
5154
55+ unsafe impl Send for TcpListener { }
56+ unsafe impl Sync for TcpListener { }
57+
5258impl TcpListener {
5359 pub fn bind ( addr : ip:: SocketAddr ) -> IoResult < TcpListener > {
5460 sys:: init_net ( ) ;
@@ -109,13 +115,19 @@ pub struct TcpAcceptor {
109115 deadline : u64 ,
110116}
111117
118+ unsafe impl Send for TcpAcceptor { }
119+ unsafe impl Sync for TcpAcceptor { }
120+
112121struct AcceptorInner {
113122 listener : TcpListener ,
114123 abort : Event ,
115124 accept : Event ,
116125 closed : atomic:: AtomicBool ,
117126}
118127
128+ unsafe impl Send for AcceptorInner { }
129+ unsafe impl Sync for AcceptorInner { }
130+
119131impl TcpAcceptor {
120132 pub fn socket ( & self ) -> sock_t { self . inner . listener . socket ( ) }
121133
You can’t perform that action at this time.
0 commit comments