made grave yard private
This commit is contained in:
parent
815b4a9073
commit
e41405f019
|
@ -14,18 +14,18 @@ import love.distributedrebirth.bassboonyd.sinit.BãßBȍőnꝐŕḯṿª₮ḕ;
|
||||||
public interface Bãß {
|
public interface Bãß {
|
||||||
|
|
||||||
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ {
|
public static final class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ {
|
||||||
protected static final Map<Object, BãßBȍőnCoffin<?>> GRAVE_YARD = new WeakHashMap<>(); // TODO: test bean gc
|
private static final Map<Object, BãßBȍőnCoffin<?>> GRAVE_YARD = new WeakHashMap<>(); // TODO: test bean gc
|
||||||
protected static final ReadWriteLock FUNERAL = new ReentrantReadWriteLock();
|
private static final ReadWriteLock FUNERAL = new ReentrantReadWriteLock();
|
||||||
|
|
||||||
private Ꝑŕḯṿª₮ḕ() {
|
private Ꝑŕḯṿª₮ḕ() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
public static <T, K extends BãßBȍőnCoffinNail> void 仙ᴵᴺᴵᵀ(BãßBȍőnʸᴰ<T,K> boon, Consumer<BãßBȍőnCoffinOpen<K>>...coffinFillers) {
|
public static final <T, K extends BãßBȍőnCoffinNail> void 仙ᴵᴺᴵᵀ(BãßBȍőnʸᴰ<T,K> boon, Consumer<BãßBȍőnCoffinOpen<K>>...coffinFillers) {
|
||||||
BãßBȍőnPhaseLoader.CAST_BONE_MAGIC(boon, coffinFillers);
|
BãßBȍőnPhaseLoader.CAST_BONE_MAGIC(boon, coffinFillers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T, K extends BãßBȍőnCoffinNail> void 鎖ᴳᴿᴬⱽᴱ(BãßBȍőnʸᴰ<T,K> boon) {
|
public static final <T, K extends BãßBȍőnCoffinNail> void 鎖ᴳᴿᴬⱽᴱ(BãßBȍőnʸᴰ<T,K> boon) {
|
||||||
BãßBȍőnCoffin<K> coffin = (BãßBȍőnCoffin<K>)boon.toBBC();
|
BãßBȍőnCoffin<K> coffin = (BãßBȍőnCoffin<K>)boon.toBBC();
|
||||||
if (!(coffin instanceof BãßBȍőnCoffinOpen)) {
|
if (!(coffin instanceof BãßBȍőnCoffinOpen)) {
|
||||||
return; // already closed
|
return; // already closed
|
||||||
|
@ -51,6 +51,29 @@ public interface Bãß {
|
||||||
// throw new RuntimeException(e);
|
// throw new RuntimeException(e);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
protected static final <T, K extends BãßBȍőnCoffinNail> BãßBȍőnCoffin<K> 殭屍ᴼᶠ(BãßBȍőnʸᴰ<T,K> boon) {
|
||||||
|
BãßBȍőnCoffin<K> zombieCoffin = null;
|
||||||
|
Lock bibleReader = Bãß.Ꝑŕḯṿª₮ḕ.FUNERAL.readLock(); // Can't force enum only, thus no jvm safety
|
||||||
|
bibleReader.lock();
|
||||||
|
try {
|
||||||
|
zombieCoffin = (BãßBȍőnCoffin<K>) Bãß.Ꝑŕḯṿª₮ḕ.GRAVE_YARD.get(boon.toBBCHeadStoneʸᴰ());
|
||||||
|
} finally {
|
||||||
|
bibleReader.unlock();
|
||||||
|
}
|
||||||
|
if (zombieCoffin == null) {
|
||||||
|
Lock shemiraWriter = Bãß.Ꝑŕḯṿª₮ḕ.FUNERAL.writeLock();
|
||||||
|
shemiraWriter.lock();
|
||||||
|
try {
|
||||||
|
zombieCoffin = BãßBȍőnCoffinOpen.newInstance();
|
||||||
|
Bãß.Ꝑŕḯṿª₮ḕ.GRAVE_YARD.put(boon.toBBCHeadStoneʸᴰ(), zombieCoffin);
|
||||||
|
} finally {
|
||||||
|
shemiraWriter.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return zombieCoffin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class Cỗᶇṧⱦᶏꬼȶʂ {
|
public static final class Cỗᶇṧⱦᶏꬼȶʂ {
|
||||||
|
|
|
@ -7,7 +7,7 @@ public interface BãßBȍőnCoffinNail {
|
||||||
|
|
||||||
String name();
|
String name();
|
||||||
|
|
||||||
static final class None implements BãßBȍőnCoffinNail {
|
public static final class None implements BãßBȍőnCoffinNail {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String name() {
|
public String name() {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package love.distributedrebirth.bassboonyd;
|
package love.distributedrebirth.bassboonyd;
|
||||||
|
|
||||||
import java.util.concurrent.locks.Lock;
|
|
||||||
|
|
||||||
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
|
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
|
||||||
|
|
||||||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||||
|
@ -12,26 +10,7 @@ public interface BãßBȍőnʸᴰ<T, K extends BãßBȍőnCoffinNail> {
|
||||||
return (T) this;
|
return (T) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
default BãßBȍőnCoffin<K> toBBC() {
|
default BãßBȍőnCoffin<K> toBBC() {
|
||||||
BãßBȍőnCoffin<K> zombieCoffin = null;
|
return Bãß.Ꝑŕḯṿª₮ḕ.殭屍ᴼᶠ(this);
|
||||||
Lock bibleReader = Bãß.Ꝑŕḯṿª₮ḕ.FUNERAL.readLock(); // Can't force enum only, thus no jvm safety
|
|
||||||
bibleReader.lock();
|
|
||||||
try {
|
|
||||||
zombieCoffin = (BãßBȍőnCoffin<K>) Bãß.Ꝑŕḯṿª₮ḕ.GRAVE_YARD.get(toBBCHeadStoneʸᴰ());
|
|
||||||
} finally {
|
|
||||||
bibleReader.unlock();
|
|
||||||
}
|
|
||||||
if (zombieCoffin == null) {
|
|
||||||
Lock shemiraWriter = Bãß.Ꝑŕḯṿª₮ḕ.FUNERAL.writeLock();
|
|
||||||
shemiraWriter.lock();
|
|
||||||
try {
|
|
||||||
zombieCoffin = BãßBȍőnCoffinOpen.newInstance();
|
|
||||||
Bãß.Ꝑŕḯṿª₮ḕ.GRAVE_YARD.put(toBBCHeadStoneʸᴰ(), zombieCoffin);
|
|
||||||
} finally {
|
|
||||||
shemiraWriter.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return zombieCoffin;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue