aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2018-09-13 13:45:59 +0200
committerThomas Guillemard <thog@protonmail.com>2018-09-13 13:45:59 +0200
commit476ebf5b0329c29136dbe2590539e3184e66ba2f (patch)
treed16d66ee27e1f368c05b09d1c35841ea441f3d4a
parente5917f896847b7d76ec98d846af87804fcd47a2e (diff)
Update IStorage.cs (#415)
Lock the stream fix a multithreading error when a XCI game try to access to the RomFs.
-rw-r--r--Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs
index 5118fa45..c3f1f2c4 100644
--- a/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs
+++ b/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs
@@ -39,8 +39,11 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
byte[] Data = new byte[Size];
- BaseStream.Seek(Offset, SeekOrigin.Begin);
- BaseStream.Read(Data, 0, Data.Length);
+ lock (BaseStream)
+ {
+ BaseStream.Seek(Offset, SeekOrigin.Begin);
+ BaseStream.Read(Data, 0, Data.Length);
+ }
Context.Memory.WriteBytes(BuffDesc.Position, Data);
}
@@ -48,4 +51,4 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
return 0;
}
}
-} \ No newline at end of file
+}