mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-04 00:46:08 +00:00
Fix creation deadlock (#1154)
This commit is contained in:
parent
474e033c2b
commit
ce0092c52a
@ -113,7 +113,6 @@ public class IrisJigsawStructure extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
}
|
||||
pieces.addIfMissing(p);
|
||||
}
|
||||
|
||||
public int getMaxDimension() {
|
||||
@ -140,6 +139,14 @@ public class IrisJigsawStructure extends IrisRegistrant {
|
||||
loadPiece(i, pools, pieces);
|
||||
}
|
||||
|
||||
if (pieces.isEmpty()) {
|
||||
int max = 0;
|
||||
for (String i : getPieces()) {
|
||||
max = Math.max(max, getLoader().getJigsawPieceLoader().load(i).getMax2dDimension());
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
int avg = 0;
|
||||
|
||||
for (String i : pieces) {
|
||||
|
@ -26,7 +26,6 @@ import com.volmit.iris.util.matter.IrisMatter;
|
||||
import com.volmit.iris.util.matter.Matter;
|
||||
import com.volmit.iris.util.matter.MatterSlice;
|
||||
import lombok.Getter;
|
||||
import lombok.Synchronized;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -117,17 +116,16 @@ public class MantleChunk {
|
||||
ref.decrementAndGet();
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
public void flag(MantleFlag flag, boolean f) {
|
||||
flags.set(flag.ordinal(), f ? 1 : 0);
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
public void raiseFlag(MantleFlag flag, Runnable r) {
|
||||
if (!isFlagged(flag)) {
|
||||
flag(flag, true);
|
||||
r.run();
|
||||
synchronized (this) {
|
||||
if (!isFlagged(flag)) flag(flag, true);
|
||||
else return;
|
||||
}
|
||||
r.run();
|
||||
}
|
||||
|
||||
public boolean isFlagged(MantleFlag flag) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user