diff options
author | Luck <git@lucko.me> | 2022-07-17 12:19:03 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-07-17 12:19:03 +0100 |
commit | 319aae27ad290338a5558ac53517e144254a86ce (patch) | |
tree | 208b8fb265976c4dc2869d4213d4c62838825f6c /spark-common/src/main/java/me/lucko/spark/common/sampler | |
parent | 06de991f44f3f0f33eed21fb92224a395a2a92ff (diff) | |
download | spark-319aae27ad290338a5558ac53517e144254a86ce.tar.gz spark-319aae27ad290338a5558ac53517e144254a86ce.tar.bz2 spark-319aae27ad290338a5558ac53517e144254a86ce.zip |
Fix fabric client startup error
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/sampler')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/sampler/ThreadDumper.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/ThreadDumper.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/ThreadDumper.java index fe3a6a7..fd0c413 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/ThreadDumper.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/ThreadDumper.java @@ -76,10 +76,24 @@ public interface ThreadDumper { * the game (server/client) thread. */ final class GameThread implements Supplier<ThreadDumper> { + private Supplier<Thread> threadSupplier; private Specific dumper = null; + public GameThread() { + + } + + public GameThread(Supplier<Thread> threadSupplier) { + this.threadSupplier = threadSupplier; + } + @Override public ThreadDumper get() { + if (this.dumper == null) { + setThread(this.threadSupplier.get()); + this.threadSupplier = null; + } + return Objects.requireNonNull(this.dumper, "dumper"); } |