Fixed potential grid thread deadlock

This commit is contained in:
Calclavia 2014-03-11 22:18:56 +08:00
parent 5d10f1412f
commit 60f13cabe8
2 changed files with 11 additions and 14 deletions

View file

@ -21,8 +21,6 @@ public abstract class NodeGrid<N extends Node> extends Grid<N>
AbstractMap<Object, ForgeDirection> connections = node.getConnections();
synchronized (connections)
{
for (Object connection : connections.keySet())
{
if (isValidNode(connection) && connection instanceof Node)
@ -42,7 +40,6 @@ public abstract class NodeGrid<N extends Node> extends Grid<N>
}
}
}
}
@Override
public void deconstruct()

View file

@ -20,7 +20,7 @@ public class TickingGrid<N extends Node> extends NodeGrid<N> implements IUpdate
@Override
public void update()
{
// synchronized (nodes)
synchronized (nodes)
{
for (Node node : nodes)
{