Remove deadlock issue, use raw segmented array types

This commit is contained in:
Asriel Camora
2023-07-05 10:22:09 +02:00
parent 4d96fd173f
commit 1f5da66bc6
4 changed files with 80 additions and 39 deletions
+3 -3
View File
@@ -56,8 +56,8 @@ public struct ActionSet
public readonly ActionType SelectRandom(Random random) => First();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ActionType? PopRandom(Random random) => PopFirst();
/*public ActionType? PopRandom(Random random)
//public ActionType? PopRandom(Random random) => PopFirst();
public ActionType? PopRandom(Random random)
{
uint snapshot;
uint newValue;
@@ -76,7 +76,7 @@ public struct ActionSet
}
while (Interlocked.CompareExchange(ref bits, newValue, snapshot) != snapshot);
return action;
}*/
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ActionType? PopFirst()