From 476ebf5b0329c29136dbe2590539e3184e66ba2f Mon Sep 17 00:00:00 2001 From: Ac_K Date: Thu, 13 Sep 2018 13:45:59 +0200 Subject: [PATCH] Update IStorage.cs (#415) Lock the stream fix a multithreading error when a XCI game try to access to the RomFs. --- Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs | 9 ++++++--- 1 file 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 +}