Archive incari-client (client, 26.3, clean)
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Sat, 26 Sep 2026 11:06:21 -0400
|
||||
Subject: [PATCH] threads: Let the platform run or size the background executor
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/Util.java b/src/main/java/net/minecraft/util/Util.java
|
||||
index f0552281f421b4da1e1c078943b4e5385713430e..60d1eb2e431ef9395924897dda3cf1d71a4626f8 100644
|
||||
--- a/src/main/java/net/minecraft/util/Util.java
|
||||
+++ b/src/main/java/net/minecraft/util/Util.java
|
||||
@@ -200,3 +200,9 @@
|
||||
private static TracingExecutor makeExecutor(final String name) {
|
||||
- int threads = maxAllowedExecutorThreads();
|
||||
+ // Incari start: the platform runs the pool itself (the browser: between frames), or decides how many threads it has (0 runs tasks inline)
|
||||
+ ExecutorService platformPool = incari.client.platform.ClientPlatform.get().threads().backgroundExecutor(name);
|
||||
+ if (platformPool != null) {
|
||||
+ return new TracingExecutor(platformPool);
|
||||
+ }
|
||||
+ int threads = incari.client.platform.ClientPlatform.get().threads().backgroundThreads(maxAllowedExecutorThreads());
|
||||
+ // Incari end
|
||||
ExecutorService executor;
|
||||
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Thu, 1 Oct 2026 08:09:27 -0400
|
||||
Subject: [PATCH] threads: Read finished futures without join
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/client/gui/font/FontManager.java b/src/main/java/net/minecraft/client/gui/font/FontManager.java
|
||||
index 9ae1d0028f26a1016046b491143bf0cb71a39a87..b31679c89987457073c5c6c2bd63441c1c47de62 100644
|
||||
--- a/src/main/java/net/minecraft/client/gui/font/FontManager.java
|
||||
+++ b/src/main/java/net/minecraft/client/gui/font/FontManager.java
|
||||
@@ -297,3 +297,5 @@
|
||||
.map(
|
||||
- provider -> provider.join().map(p -> List.of(new GlyphProvider.Conditional(p, this.filter))),
|
||||
+ // Incari start: resolved only after every provider has loaded, so read it without join: a blocking call in this Function made every Function.apply a coroutine (ADR 0027)
|
||||
+ provider -> provider.resultNow().map(p -> List.of(new GlyphProvider.Conditional(p, this.filter))),
|
||||
+ // Incari end
|
||||
reference -> {
|
||||
diff --git a/src/main/java/net/minecraft/util/Util.java b/src/main/java/net/minecraft/util/Util.java
|
||||
index 60d1eb2e431ef9395924897dda3cf1d71a4626f8..151fbbc4c7a0828fca6631791368be396097802e 100644
|
||||
--- a/src/main/java/net/minecraft/util/Util.java
|
||||
+++ b/src/main/java/net/minecraft/util/Util.java
|
||||
@@ -670,3 +670,5 @@
|
||||
CompletableFuture<Void> all = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
|
||||
- return all.thenApply(ignored -> futures.stream().map(CompletableFuture::join).toList());
|
||||
+ // Incari start: every future has completed normally here, so read it without join: a blocking call in this Function made every Function.apply a coroutine (ADR 0027)
|
||||
+ return all.thenApply(ignored -> futures.stream().map(CompletableFuture::resultNow).toList());
|
||||
+ // Incari end
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Fri, 2 Oct 2026 07:53:23 -0400
|
||||
Subject: [PATCH] threads: Skip the chunk palettes' threading checks on one
|
||||
thread
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/ThreadingDetector.java b/src/main/java/net/minecraft/util/ThreadingDetector.java
|
||||
index 7eb0de4f4abeba928eac78e564b724ea618f276c..b7527ea8edceca57cafcf46ae7dec6de52a638e2 100644
|
||||
--- a/src/main/java/net/minecraft/util/ThreadingDetector.java
|
||||
+++ b/src/main/java/net/minecraft/util/ThreadingDetector.java
|
||||
@@ -29,2 +29,5 @@
|
||||
public void checkAndLock() {
|
||||
+ // Incari start: one thread can't race itself (ADR 0030)
|
||||
+ if (incari.client.platform.ClientPlatform.oneThread()) return;
|
||||
+ // Incari end
|
||||
boolean released = false;
|
||||
@@ -54,2 +57,5 @@
|
||||
public void checkAndUnlock() {
|
||||
+ // Incari start: one thread can't race itself (ADR 0030)
|
||||
+ if (incari.client.platform.ClientPlatform.oneThread()) return;
|
||||
+ // Incari end
|
||||
try {
|
||||
Reference in New Issue
Block a user