mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
Add new analyzers.
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using RomRepoMgr.Database;
|
||||
using RomRepoMgr.Database.Models;
|
||||
@@ -418,12 +419,20 @@ public class Vfs : IDisposable
|
||||
{
|
||||
if(!_streamsCache.TryGetValue(handle, out Stream stream)) return -1;
|
||||
|
||||
lock(stream)
|
||||
using var rwLock = new ReaderWriterLockSlim();
|
||||
|
||||
try
|
||||
{
|
||||
rwLock.EnterReadLock();
|
||||
|
||||
stream.Position = offset;
|
||||
|
||||
return stream.Read(buf, 0, buf.Length);
|
||||
}
|
||||
finally
|
||||
{
|
||||
rwLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
internal bool Close(long handle)
|
||||
|
||||
Reference in New Issue
Block a user