Fix atomicity of file reading in VFS.

This commit is contained in:
2020-09-04 21:03:24 +01:00
parent c0b1a7729c
commit 250f85de6c

View File

@@ -364,9 +364,12 @@ namespace RomRepoMgr.Core.Filesystem
if(!_streamsCache.TryGetValue(handle, out Stream stream))
return -1;
stream.Position = offset;
lock(stream)
{
stream.Position = offset;
return stream.Read(buf, 0, buf.Length);
return stream.Read(buf, 0, buf.Length);
}
}
internal bool Close(long handle)