mirror of
https://git.ryujinx.app/projects/Ryubing.git
synced 2026-10-23 10:12:19 -05:00
HashSet is not thread safe, hopefully this fixes the CPU issue where it throws a exception on Add
This commit is contained in:
1 parent
a20d6b34ab
commit
e16ca561cb
1 file changed
+16
-10
+16
-10
@@ -107,25 +107,31 @@ namespace ChocolArm64
|
||||
|
||||
ATranslatedSub Subroutine = Context.GetSubroutine();
|
||||
|
||||
if (SubBlocks.Contains(Position))
|
||||
lock (SubBlocks)
|
||||
{
|
||||
SubBlocks.Remove(Position);
|
||||
if (SubBlocks.Contains(Position))
|
||||
{
|
||||
SubBlocks.Remove(Position);
|
||||
|
||||
Subroutine.SetType(ATranslatedSubType.SubBlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
Subroutine.SetType(ATranslatedSubType.SubTier0);
|
||||
Subroutine.SetType(ATranslatedSubType.SubBlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
Subroutine.SetType(ATranslatedSubType.SubTier0);
|
||||
}
|
||||
}
|
||||
|
||||
CachedSubs.AddOrUpdate(Position, Subroutine, (Key, OldVal) => Subroutine);
|
||||
|
||||
AOpCode LastOp = Block.GetLastOp();
|
||||
|
||||
if (LastOp.Emitter != AInstEmit.Ret &&
|
||||
LastOp.Emitter != AInstEmit.Br)
|
||||
lock (SubBlocks)
|
||||
{
|
||||
SubBlocks.Add(LastOp.Position + 4);
|
||||
if (LastOp.Emitter != AInstEmit.Ret &&
|
||||
LastOp.Emitter != AInstEmit.Br)
|
||||
{
|
||||
SubBlocks.Add(LastOp.Position + 4);
|
||||
}
|
||||
}
|
||||
|
||||
return Subroutine;
|
||||
|
||||
Reference in new issue
Block a user