Fix race in ForgeTest.modsUseTheirThreadTheMainThreadAndEvents

This commit is contained in:
Overlord committed 2026-10-07 08:13:45 +02:00
1 parent 68f090061f
commit 28b3510c10
1 file changed
+2 -1
+2 -1
View File
@@ -32,8 +32,9 @@ public final class ThreadMod extends Mod
public void onServerStarted() public void onServerStarted()
{ {
this.modThread().execute(() -> { this.modThread().execute(() -> {
this.log.add("work on " + Thread.currentThread().getName()); // Hand-off before the log entry: tests that see the entry know the task is queued.
this.main().execute(() -> this.log.add("result on " + Thread.currentThread().getName())); this.main().execute(() -> this.log.add("result on " + Thread.currentThread().getName()));
this.log.add("work on " + Thread.currentThread().getName());
}); });
} }