Fix race condition
parent
418e8410c7
commit
230e9476a7
|
@ -24,8 +24,13 @@ TUPLE: fd fd disposed ;
|
|||
[ >>fd ]
|
||||
tri ;
|
||||
|
||||
M: fd dispose*
|
||||
[ cancel-operation ] [ fd>> close-file ] bi ;
|
||||
M: fd dispose
|
||||
dup disposed>> [ drop ] [
|
||||
[ cancel-operation ]
|
||||
[ t >>disposed drop ]
|
||||
[ fd>> close-file ]
|
||||
tri
|
||||
] if ;
|
||||
|
||||
M: fd handle-fd dup check-disposed fd>> ;
|
||||
|
||||
|
|
|
@ -24,8 +24,10 @@ TUPLE: win32-file < win32-handle ptr ;
|
|||
: <win32-file> ( handle -- win32-file )
|
||||
win32-file new-win32-handle ;
|
||||
|
||||
M: win32-file dispose*
|
||||
[ cancel-operation ] [ call-next-method ] bi ;
|
||||
M: win32-file dispose
|
||||
dup disposed>> [ drop ] [
|
||||
[ cancel-operation ] [ call-next-method ] bi
|
||||
] if ;
|
||||
|
||||
HOOK: CreateFile-flags io-backend ( DWORD -- DWORD )
|
||||
HOOK: FileArgs-overlapped io-backend ( port -- overlapped/f )
|
||||
|
|
Loading…
Reference in New Issue