From 658f29fb5bfc1a84c2b0ceb87a6225680012b599 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 30 Oct 2025 12:52:28 -0400 Subject: [PATCH] v3.3.0: removed deadlock-causing sync checks --- .../scenes/GameScene.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 4e9d78ee5..0c53406b6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -172,7 +172,7 @@ public class GameScene extends PixelScene { private BossHealthBar boss; private GameLog log; - + private static CellSelector cellSelector; private Group terrain; @@ -209,7 +209,7 @@ public class GameScene extends PixelScene { { inGameScene = true; } - + @Override public void create() { @@ -530,7 +530,7 @@ public class GameScene extends PixelScene { } layoutTags(); - + switch (InterlevelScene.mode) { case RESURRECT: Sample.INSTANCE.play(Assets.Sounds.TELEPORT); @@ -831,7 +831,7 @@ public class GameScene extends PixelScene { public static boolean updateTags = false; private static float waterOfs = 0; - + @Override public synchronized void update() { lastOffset = null; @@ -869,7 +869,7 @@ public class GameScene extends PixelScene { Actor.process(); } }; - + //if cpu cores are limited, game should prefer drawing the current frame if (Runtime.getRuntime().availableProcessors() == 1) { actorThread.setPriority(Thread.NORM_PRIORITY - 1); @@ -1028,22 +1028,25 @@ public class GameScene extends PixelScene { public void addCustomWall( CustomTilemap visual){ customWalls.add( visual.create() ); } - - private synchronized void addHeapSprite( Heap heap ) { + + //FIXME added a sync check here in v3.2.5, which caused deadlocks + // what I really need to do is have these queue additions that then happen on render thread + // this can also apply to adding mob sprites + private void addHeapSprite( Heap heap ) { ItemSprite sprite = heap.sprite = (ItemSprite)heaps.recycle( ItemSprite.class ); sprite.revive(); sprite.link( heap ); heaps.add( sprite ); } - private synchronized void addDiscardedSprite( Heap heap ) { + private void addDiscardedSprite( Heap heap ) { heap.sprite = (DiscardedItemSprite)heaps.recycle( DiscardedItemSprite.class ); heap.sprite.revive(); heap.sprite.link( heap ); heaps.add( heap.sprite ); } - private synchronized void addBlobSprite( final Blob gas ) { + private void addBlobSprite( final Blob gas ) { if (gas.emitter == null) { gases.add( new BlobEmitter( gas ) ); } @@ -1340,7 +1343,7 @@ public class GameScene extends PixelScene { scene.terrainFeatures.growPlant( cell ); } } - + public static void discoverTile( int pos, int oldValue ) { if (scene != null) { scene.tiles.discover( pos, oldValue ); @@ -1581,7 +1584,7 @@ public class GameScene extends PixelScene { return wnd; } } - + return null; }