Skip to content

Commit

Permalink
Disable IOCP on FileStream
Browse files Browse the repository at this point in the history
Disposing a stream immediately after making a CopyTo call will cause the
FileStream to deadlock, which is Pretty Neat™. 
  • Loading branch information
Paul Betts committed Mar 5, 2013
1 parent 585935f commit 2917a5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Akavache/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static IObservable<Stream> SafeOpenFileAsync(string path, FileMode mode,
.Select(x => x.AsStream())
.Subscribe(ret);
#else
Observable.Start(() => new FileStream(path, mode, access, share, 4096, true), scheduler).Cast<Stream>().Subscribe(ret);
Observable.Start(() => new FileStream(path, mode, access, share, 4096, false), scheduler).Cast<Stream>().Subscribe(ret);
#endif
}
catch (Exception ex)
Expand Down

1 comment on commit 2917a5e

@haacked
Copy link
Contributor

@haacked haacked commented on 2917a5e Mar 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Please sign in to comment.