@@ -227,20 +227,20 @@ impl IoFactory {
227227
228228impl rtio:: IoFactory for IoFactory {
229229 // networking
230- fn tcp_connect ( & mut self , addr : SocketAddr ) -> IoResult < ~RtioTcpStream > {
231- net:: TcpStream :: connect ( addr) . map ( |s| ~s as ~RtioTcpStream )
230+ fn tcp_connect ( & mut self , addr : SocketAddr ) -> IoResult < ~RtioTcpStream : Send > {
231+ net:: TcpStream :: connect ( addr) . map ( |s| ~s as ~RtioTcpStream : Send )
232232 }
233- fn tcp_bind ( & mut self , addr : SocketAddr ) -> IoResult < ~RtioTcpListener > {
234- net:: TcpListener :: bind ( addr) . map ( |s| ~s as ~RtioTcpListener )
233+ fn tcp_bind ( & mut self , addr : SocketAddr ) -> IoResult < ~RtioTcpListener : Send > {
234+ net:: TcpListener :: bind ( addr) . map ( |s| ~s as ~RtioTcpListener : Send )
235235 }
236- fn udp_bind ( & mut self , addr : SocketAddr ) -> IoResult < ~RtioUdpSocket > {
237- net:: UdpSocket :: bind ( addr) . map ( |u| ~u as ~RtioUdpSocket )
236+ fn udp_bind ( & mut self , addr : SocketAddr ) -> IoResult < ~RtioUdpSocket : Send > {
237+ net:: UdpSocket :: bind ( addr) . map ( |u| ~u as ~RtioUdpSocket : Send )
238238 }
239- fn unix_bind ( & mut self , path : & CString ) -> IoResult < ~RtioUnixListener > {
240- pipe:: UnixListener :: bind ( path) . map ( |s| ~s as ~RtioUnixListener )
239+ fn unix_bind ( & mut self , path : & CString ) -> IoResult < ~RtioUnixListener : Send > {
240+ pipe:: UnixListener :: bind ( path) . map ( |s| ~s as ~RtioUnixListener : Send )
241241 }
242- fn unix_connect ( & mut self , path : & CString ) -> IoResult < ~RtioPipe > {
243- pipe:: UnixStream :: connect ( path) . map ( |s| ~s as ~RtioPipe )
242+ fn unix_connect ( & mut self , path : & CString ) -> IoResult < ~RtioPipe : Send > {
243+ pipe:: UnixStream :: connect ( path) . map ( |s| ~s as ~RtioPipe : Send )
244244 }
245245 fn get_host_addresses ( & mut self , host : Option < & str > , servname : Option < & str > ,
246246 hint : Option < ai:: Hint > ) -> IoResult < ~[ ai:: Info ] > {
@@ -249,16 +249,16 @@ impl rtio::IoFactory for IoFactory {
249249
250250 // filesystem operations
251251 fn fs_from_raw_fd ( & mut self , fd : c_int ,
252- close : CloseBehavior ) -> ~RtioFileStream {
252+ close : CloseBehavior ) -> ~RtioFileStream : Send {
253253 let close = match close {
254254 rtio:: CloseSynchronously | rtio:: CloseAsynchronously => true ,
255255 rtio:: DontClose => false
256256 } ;
257- ~file:: FileDesc :: new ( fd, close) as ~RtioFileStream
257+ ~file:: FileDesc :: new ( fd, close) as ~RtioFileStream : Send
258258 }
259259 fn fs_open ( & mut self , path : & CString , fm : io:: FileMode , fa : io:: FileAccess )
260- -> IoResult < ~RtioFileStream > {
261- file:: open ( path, fm, fa) . map ( |fd| ~fd as ~RtioFileStream )
260+ -> IoResult < ~RtioFileStream : Send > {
261+ file:: open ( path, fm, fa) . map ( |fd| ~fd as ~RtioFileStream : Send )
262262 }
263263 fn fs_unlink ( & mut self , path : & CString ) -> IoResult < ( ) > {
264264 file:: unlink ( path)
@@ -304,25 +304,27 @@ impl rtio::IoFactory for IoFactory {
304304 }
305305
306306 // misc
307- fn timer_init ( & mut self ) -> IoResult < ~RtioTimer > {
308- timer:: Timer :: new ( ) . map ( |t| ~t as ~RtioTimer )
307+ fn timer_init ( & mut self ) -> IoResult < ~RtioTimer : Send > {
308+ timer:: Timer :: new ( ) . map ( |t| ~t as ~RtioTimer : Send )
309309 }
310310 fn spawn ( & mut self , config : ProcessConfig )
311- -> IoResult < ( ~RtioProcess , ~[ Option < ~RtioPipe > ] ) > {
311+ -> IoResult < ( ~RtioProcess : Send , ~[ Option < ~RtioPipe : Send > ] ) > {
312312 process:: Process :: spawn ( config) . map ( |( p, io) | {
313- ( ~p as ~RtioProcess ,
314- io. move_iter ( ) . map ( |p| p. map ( |p| ~p as ~RtioPipe ) ) . collect ( ) )
313+ ( ~p as ~RtioProcess : Send ,
314+ io. move_iter ( ) . map ( |p| p. map ( |p| ~p as ~RtioPipe : Send ) ) . collect ( ) )
315315 } )
316316 }
317317 fn kill ( & mut self , pid : libc:: pid_t , signum : int ) -> IoResult < ( ) > {
318318 process:: Process :: kill ( pid, signum)
319319 }
320- fn pipe_open ( & mut self , fd : c_int ) -> IoResult < ~RtioPipe > {
321- Ok ( ~file:: FileDesc :: new ( fd, true ) as ~RtioPipe )
320+ fn pipe_open ( & mut self , fd : c_int ) -> IoResult < ~RtioPipe : Send > {
321+ Ok ( ~file:: FileDesc :: new ( fd, true ) as ~RtioPipe : Send )
322322 }
323- fn tty_open ( & mut self , fd : c_int , _readable : bool ) -> IoResult < ~RtioTTY > {
323+ fn tty_open ( & mut self , fd : c_int , _readable : bool )
324+ -> IoResult < ~RtioTTY : Send >
325+ {
324326 if unsafe { libc:: isatty ( fd) } != 0 {
325- Ok ( ~file:: FileDesc :: new ( fd, true ) as ~RtioTTY )
327+ Ok ( ~file:: FileDesc :: new ( fd, true ) as ~RtioTTY : Send )
326328 } else {
327329 Err ( IoError {
328330 kind : io:: MismatchedFileTypeForOperation ,
@@ -332,7 +334,7 @@ impl rtio::IoFactory for IoFactory {
332334 }
333335 }
334336 fn signal ( & mut self , _signal : Signum , _channel : Sender < Signum > )
335- -> IoResult < ~RtioSignal > {
337+ -> IoResult < ~RtioSignal : Send > {
336338 Err ( unimpl ( ) )
337339 }
338340}
0 commit comments