Stop overlocking

This commit is contained in:
Daniel Mills 2020-08-16 21:26:27 -04:00
parent 633fea8c68
commit 81f6ce26d4
3 changed files with 0 additions and 18 deletions

View File

@ -34,7 +34,6 @@ import com.volmit.iris.object.IrisRegion;
import com.volmit.iris.object.IrisStructure; import com.volmit.iris.object.IrisStructure;
import com.volmit.iris.util.B; import com.volmit.iris.util.B;
import com.volmit.iris.util.ChronoLatch; import com.volmit.iris.util.ChronoLatch;
import com.volmit.iris.util.IrisLock;
import com.volmit.iris.util.J; import com.volmit.iris.util.J;
import com.volmit.iris.util.M; import com.volmit.iris.util.M;
import com.volmit.iris.util.PrecisionStopwatch; import com.volmit.iris.util.PrecisionStopwatch;
@ -59,7 +58,6 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
protected ChronoLatch tickLatch; protected ChronoLatch tickLatch;
protected ChronoLatch pushLatch; protected ChronoLatch pushLatch;
protected IrisMetrics metrics; protected IrisMetrics metrics;
protected IrisLock hlock;
protected World world; protected World world;
protected int generated; protected int generated;
protected int ticks; protected int ticks;
@ -74,7 +72,6 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
tickLatch = new ChronoLatch(650); tickLatch = new ChronoLatch(650);
perSecond = new ChronoLatch(1000); perSecond = new ChronoLatch(1000);
hlast = M.ms(); hlast = M.ms();
hlock = new IrisLock("HotLock");
cache = new AtomicMulticache(); cache = new AtomicMulticache();
CNG.creates = 0; CNG.creates = 0;
generated = 0; generated = 0;
@ -318,7 +315,6 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
@Override @Override
public ChunkData generateChunkData(World world, Random no, int x, int z, BiomeGrid biomeGrid) public ChunkData generateChunkData(World world, Random no, int x, int z, BiomeGrid biomeGrid)
{ {
hlock.lock();
setHotloadable(false); setHotloadable(false);
if(!dev) if(!dev)
{ {
@ -330,7 +326,6 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
if(failing) if(failing)
{ {
hlock.unlock();
return generateChunkDataFailure(world, no, x, z, biomeGrid); return generateChunkDataFailure(world, no, x, z, biomeGrid);
} }
@ -359,7 +354,6 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
Iris.instance.hit(hits); Iris.instance.hit(hits);
metrics.getLoss().put(sx.getMilliseconds() - s.getMilliseconds()); metrics.getLoss().put(sx.getMilliseconds() - s.getMilliseconds());
setHotloadable(true); setHotloadable(true);
hlock.unlock();
return c; return c;
} }
@ -369,7 +363,6 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
} }
setHotloadable(true); setHotloadable(true);
hlock.unlock();
return generateChunkDataFailure(world, no, x, z, biomeGrid); return generateChunkDataFailure(world, no, x, z, biomeGrid);
} }
@ -380,12 +373,10 @@ public abstract class ContextualChunkGenerator extends ChunkGenerator implements
return; return;
} }
hlock.lock();
if(world != null) if(world != null)
{ {
checkHotload(world); checkHotload(world);
} }
hlock.unlock();
} }
private void checkHotload(World world) private void checkHotload(World world)

View File

@ -8,7 +8,6 @@ import com.volmit.iris.gen.atomics.AtomicSliverMap;
import com.volmit.iris.util.BiomeMap; import com.volmit.iris.util.BiomeMap;
import com.volmit.iris.util.GroupedExecutor; import com.volmit.iris.util.GroupedExecutor;
import com.volmit.iris.util.HeightMap; import com.volmit.iris.util.HeightMap;
import com.volmit.iris.util.IrisLock;
import com.volmit.iris.util.PrecisionStopwatch; import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG; import com.volmit.iris.util.RNG;
@ -23,7 +22,6 @@ public abstract class ParallelChunkGenerator extends DimensionChunkGenerator
private int threads; private int threads;
protected int cacheX; protected int cacheX;
protected int cacheZ; protected int cacheZ;
private IrisLock genlock;
protected boolean cachingAllowed; protected boolean cachingAllowed;
public ParallelChunkGenerator(String dimensionName, int threads) public ParallelChunkGenerator(String dimensionName, int threads)
@ -32,7 +30,6 @@ public abstract class ParallelChunkGenerator extends DimensionChunkGenerator
cacheX = 0; cacheX = 0;
cacheZ = 0; cacheZ = 0;
this.threads = threads; this.threads = threads;
genlock = new IrisLock("ParallelGenLock");
cachingAllowed = false; cachingAllowed = false;
} }
@ -67,7 +64,6 @@ public abstract class ParallelChunkGenerator extends DimensionChunkGenerator
protected void onGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid) protected void onGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid)
{ {
genlock.lock();
cacheX = x; cacheX = x;
cacheZ = z; cacheZ = z;
getCache().targetChunk(cacheX, cacheZ); getCache().targetChunk(cacheX, cacheZ);
@ -101,7 +97,6 @@ public abstract class ParallelChunkGenerator extends DimensionChunkGenerator
getMetrics().getTerrain().put(p.getMilliseconds()); getMetrics().getTerrain().put(p.getMilliseconds());
p = PrecisionStopwatch.start(); p = PrecisionStopwatch.start();
onPostGenerate(random, x, z, data, grid, height, biomeMap); onPostGenerate(random, x, z, data, grid, height, biomeMap);
genlock.unlock();
} }
protected void onClose() protected void onClose()

View File

@ -644,10 +644,6 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator
return Math.max(getTerrainHeight(x, z), getFluidHeight()); return Math.max(getTerrainHeight(x, z), getFluidHeight());
} }
////////////////////
// BIOME METHODS
///////////////////
@Override @Override
public void onHotload() public void onHotload()
{ {