Check if the handle has been disposed. This can happen if we close one end of a duplex stream
parent
26950d9830
commit
3b2f4d92d2
|
@ -125,7 +125,8 @@ M: fd refill
|
|||
} cond ;
|
||||
|
||||
M: unix (wait-to-read) ( port -- )
|
||||
dup dup handle>> refill dup
|
||||
dup
|
||||
dup handle>> dup check-disposed refill dup
|
||||
[ dupd wait-for-port (wait-to-read) ] [ 2drop ] if ;
|
||||
|
||||
! Writers
|
||||
|
@ -144,7 +145,9 @@ M: fd drain
|
|||
} cond ;
|
||||
|
||||
M: unix (wait-to-write) ( port -- )
|
||||
dup dup handle>> drain dup [ wait-for-port ] [ 2drop ] if ;
|
||||
dup
|
||||
dup handle>> dup check-disposed drain
|
||||
dup [ wait-for-port ] [ 2drop ] if ;
|
||||
|
||||
M: unix io-multiplex ( ms/f -- )
|
||||
mx get-global wait-for-events ;
|
||||
|
|
|
@ -61,6 +61,7 @@ C: <FileArgs> FileArgs
|
|||
|
||||
: make-FileArgs ( port -- <FileArgs> )
|
||||
{
|
||||
[ handle>> check-disposed ]
|
||||
[ handle>> handle>> ]
|
||||
[ buffer>> ]
|
||||
[ buffer>> buffer-length ]
|
||||
|
|
|
@ -74,7 +74,7 @@ M: winnt add-completion ( win32-handle -- )
|
|||
] if ;
|
||||
|
||||
M: win32-handle cancel-operation
|
||||
handle>> CancelIo drop ;
|
||||
[ check-disposed ] [ handle>> CancelIo drop ] bi ;
|
||||
|
||||
M: winnt io-multiplex ( ms -- )
|
||||
handle-overlapped [ 0 io-multiplex ] when ;
|
||||
|
|
Loading…
Reference in New Issue