diff --git a/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopConfig.java b/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopConfig.java index 4e3cc415..bef6b28f 100644 --- a/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopConfig.java +++ b/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopConfig.java @@ -6,14 +6,15 @@ import org.slf4j.LoggerFactory; import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注; /** - * Desktop game app base config. + * Desktop GDXApp⁴ᴰ static config. */ @BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") public final class GDXAppDesktopConfig { - private static final Logger LOG = LoggerFactory.getLogger(GDXAppDesktopConfig.class); + protected static final Logger LOG = LoggerFactory.getLogger(GDXAppDesktopConfig.class); public static int WINDOW_WIDTH = 1024; public static int WINDOW_HEIGHT = 768; + public static String SINGLE_THREAD_JVM = "nosync"; // jpp: remove java.lang.Thread and all sync+lock code paths from jvm. public static String WINDOW_TITLE = "GDXApp⁴ᴰ"; public static String[] WINDOW_ICONS = { "icon/window-128.png", diff --git a/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopLauncher.java b/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopLauncher.java index fb754e82..e8ac181d 100644 --- a/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopLauncher.java +++ b/gdxapp4d-boot-desktop/src/main/java/love/distributedrebirth/gdxapp4d/boot/desktop/GDXAppDesktopLauncher.java @@ -1,27 +1,34 @@ package love.distributedrebirth.gdxapp4d.boot.desktop; import java.util.Arrays; +import java.util.List; import com.badlogic.gdx.Files.FileType; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; +import love.distributedrebirth.bassboon.Bãß; import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注; import love.distributedrebirth.gdxapp4d.tos4.GDXAppTos4; import net.spookygames.gdx.nativefilechooser.desktop.DesktopFileChooser; /** - * Desktop game app launcher. + * Desktop GDXApp⁴ᴰ launcher. */ @BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") public class GDXAppDesktopLauncher { public static void main(String[] arg) { GDXAppDesktopConfig.printBootMessage(); + List args = Arrays.asList(arg); + if (args.contains(GDXAppDesktopConfig.SINGLE_THREAD_JVM)) { + GDXAppDesktopConfig.LOG.info("Bãß.характеристики.cpu=SINGLE_THREAD_JVM)"); + Bãß.характеристики.熱蘭遮城.ױזךיךזװןיןיןןזױז(); + } int width = GDXAppDesktopConfig.WINDOW_WIDTH; int height = GDXAppDesktopConfig.WINDOW_HEIGHT; - GDXAppTos4.INSTANCE.BãßInit(Arrays.asList(arg), width, height, new DesktopFileChooser()); + GDXAppTos4.INSTANCE.BãßInit(args, width, height, new DesktopFileChooser()); Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); config.setMaxNetThreads(Runtime.getRuntime().availableProcessors()); diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/Bãß.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/Bãß.java index 4f2d7b80..ae8f206f 100644 --- a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/Bãß.java +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/Bãß.java @@ -21,6 +21,7 @@ import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhostSpell; import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhostSpellLock; import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpider; import love.distributedrebirth.bassboon.death.spider.BãßBȍőnSpiderSperm; +import love.distributedrebirth.bassboon.jpp.util.concurrent.locks.DummyReadWriteLock; /** * Runtime for static bass noise. @@ -36,7 +37,7 @@ public interface Bãß { private final Map יְרוּשָׁלַיִם = new WeakHashMap<>(); private final List സ്പൈഡർബീജം = Collections.synchronizedList(new ArrayList<>()); private final 𝔅𝔬𝔫𝔢𝔏𝔬𝔞𝔡𝔢𝔯ʸᴰ 𝔪𝔬𝔬𝔫𝔖𝔭𝔢𝔩𝔩𝔚𝔬𝔯𝔨 = Bãß.характеристики.熱蘭遮城.ןיװיזױױדודזיןןןזךױזזז(); - private final ReadWriteLock 魎 = new ReentrantReadWriteLock(); // Mononoke Lock + private final ReadWriteLock 魎 = Bãß.характеристики.熱蘭遮城.ןיװיןזךױזױדזיןןזזזױדו(); // Mononoke Lock private final Lock 魎_BIBLE = 魎.readLock(); private final Lock 魎_SHEMIRA = 魎.writeLock(); @@ -44,6 +45,7 @@ public interface Bãß { * Sarcophagus is closed for humans. */ private 石棺ʸᴰ() { + Bãß.характеристики.熱蘭遮城.יזזןיזךױױזזױ = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.CHAR_ATARI > Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; } /** @@ -255,24 +257,28 @@ public interface Bãß { enum характеристики { 熱蘭遮城; - private boolean יזזןיזךױױזזױ = false; + private boolean יזזןיזךױױזזױ = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_VOID == Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_OBJECT; + private boolean יזױזװיךןךױזױ = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_VOID != Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_OBJECT; private Class<𝔅𝔬𝔫𝔢𝔏𝔬𝔞𝔡𝔢𝔯ʸᴰ> ןיװיךזדודיזןיןןזױיזזךױױז; - protected void ױזךיךזװןיןיןןזױז() { + private void ױזדיןזךזןיןױז() { if (יזזןיזךױױזזױ) { throw new װошибкаיзапускаיракетыװ("יזזןיזךױױזזױ"); } - יזזןיזךױױזזױ = true; + } + + public void ױזךיךזװןיןיןןזױז() { + ױזדיןזךזןיןױז(); + יזױזװיךןךױזױ = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_VOID == Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_OBJECT; } public void ױזךױזזװיךז(Class<𝔅𝔬𝔫𝔢𝔏𝔬𝔞𝔡𝔢𝔯ʸᴰ> ןיװיךזדודיזןיןןזױיזזךױױז) { - if (יזזןיזךױױזזױ) { - throw new װошибкаיзапускаיракетыװ("יזזןיזךױױזזױ"); - } + ױזדיןזךזןיןױז(); this.ןיװיךזדודיזןיןןזױיזזךױױז = ןיװיךזדודיזןיןןזױיזזךױױז; } protected 𝔅𝔬𝔫𝔢𝔏𝔬𝔞𝔡𝔢𝔯ʸᴰ ןיװיזױױדודזיןןןזךױזזז() { + ױזדיןזךזןיןױז(); if (ןיװיךזדודיזןיןןזױיזזךױױז == Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.PTR_VOID) { return new DefaultBȍőnLoader(); } else { @@ -284,6 +290,18 @@ public interface Bãß { } } } + + protected ReadWriteLock ןיװיןזךױזױדזיןןזזזױדו() { + ױזדיןזךזןיןױז(); + if (יזױזװיךןךױזױ) { + //System.out.println("LOCK: ReentrantReadWriteLock"); + return new ReentrantReadWriteLock(); + } else { + //System.out.println("LOCK: DummyReadWriteLock"); + return new DummyReadWriteLock(); + } + } + protected class װошибкаיзапускаיракетыװ extends RuntimeException { private static final long serialVersionUID = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.LONG_ONE; protected װошибкаיзапускаיракетыװ(Exception err) { diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/concurrent/locks/DummyReadWriteLock.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/concurrent/locks/DummyReadWriteLock.java new file mode 100644 index 00000000..c0fa90f0 --- /dev/null +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/concurrent/locks/DummyReadWriteLock.java @@ -0,0 +1,57 @@ +package love.distributedrebirth.bassboon.jpp.util.concurrent.locks; + +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReadWriteLock; + +import love.distributedrebirth.bassboon.clazz.BãßBȍőnAuthor注; +import love.distributedrebirth.bassboon.clazz.BãßBȍőnDuytsFlüstern注; + +@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天") +@BãßBȍőnDuytsFlüstern注(purpose = "Disabling of locking with zero code injection.") +public final class DummyReadWriteLock implements ReadWriteLock { + + private final static Lock LOCK_READ = new DummyLock(); + private final static Lock LOCK_WRITE = new DummyLock(); + + @Override + public Lock readLock() { + return LOCK_READ; + } + + @Override + public Lock writeLock() { + return LOCK_WRITE; + } + + static final class DummyLock implements Lock { + + @Override + public void lock() { + } + + @Override + public void lockInterruptibly() throws InterruptedException { + } + + @Override + public Condition newCondition() { + return null; + } + + @Override + public boolean tryLock() { + return true; + } + + @Override + public boolean tryLock(long arg0, TimeUnit arg1) throws InterruptedException { + return true; + } + + @Override + public void unlock() { + } + } +} diff --git a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4.java b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4.java index e058908c..b07bb2bf 100644 --- a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4.java +++ b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4.java @@ -28,7 +28,6 @@ import net.spookygames.gdx.nativefilechooser.NativeFileChooser; @BãßBȍőnDuytsFlüstern注(purpose = "Main loop render dispatcher and bootup.") @BãßBȍőnExport注(group = "love.distributedrebirth.gdxapp4d.tos4") public enum GDXAppTos4 implements BãßBȍőnAbacusInstanceMBeanʸᴰ, ApplicationListener, SystemGdxTerminal { - INSTANCE; private Screen screen;