From 499a58966fb9067d58bb091a7b516619e5e3125e Mon Sep 17 00:00:00 2001 From: Federico Berti Date: Fri, 3 Nov 2023 14:11:36 +0000 Subject: [PATCH] helios: (try to) improve sound on win11, build fix --- build.gradle | 8 ++++---- src/main/java/omegadrive/util/Sleeper.java | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 57666152..ac9ac609 100644 --- a/build.gradle +++ b/build.gradle @@ -148,10 +148,10 @@ task writeToFile { ["-XX:AutoBoxCacheMax=65536", "-XX:-DontCompileHugeMethods", "-XX:+AlwaysCompileLoopMethods"] //win: default to busy wait List winOpts = ["-Dhelios.busy.wait=true"] - List sampleBase = [ "java", - "-Dtinylog.configuration=./tinylog.properties", - "-Djinput.enable=true -Djinput.native.location=lib", - "-jar", "$jarName"] as String[] + List sampleBase = ["java", + "-Dtinylog.configuration=./res/tinylog.properties", + "-Djinput.enable=true -Djinput.native.location=lib", + "-jar", "$jarName"] as String[] sampleBase.addAll(1, javaAdvOpts) List sampleUx = new ArrayList<>(sampleBase) sampleUx.add("\"\$@\"" + "\n") diff --git a/src/main/java/omegadrive/util/Sleeper.java b/src/main/java/omegadrive/util/Sleeper.java index 78c59dd4..67545d10 100644 --- a/src/main/java/omegadrive/util/Sleeper.java +++ b/src/main/java/omegadrive/util/Sleeper.java @@ -30,6 +30,7 @@ private static void startSleeperThread() { if (isWindows()) { Runnable r = () -> Util.sleep(Long.MAX_VALUE); Thread t = new Thread(r); + t.setDaemon(true); t.setName("sleeperForWindows"); t.start(); } @@ -54,6 +55,7 @@ public static void parkFuzzy(final long intervalNs) { } public static void parkExactly(final long intervalNs) { + assert intervalNs > 0; if (BUSY_WAIT) { long deadlineNs = System.nanoTime() + intervalNs; while (System.nanoTime() < deadlineNs) {