From 42938111d5529b908aafb6430f1a26231d2eaedb Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Thu, 26 Aug 2021 19:50:28 +0200 Subject: [PATCH 1/7] Allow tasks to be bound to the same thread for each run. --- .../map/framebuffers/GLFWCapableBuffer.java | 2 + .../server/timer/SchedulerManager.java | 19 +++- .../java/net/minestom/server/timer/Task.java | 30 ++++-- .../minestom/server/timer/TaskBuilder.java | 18 +++- .../utils/thread/ThreadBindingExecutor.java | 92 +++++++++++++++++++ 5 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 src/main/java/net/minestom/server/utils/thread/ThreadBindingExecutor.java diff --git a/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java b/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java index 92dc949f0..18dfb866f 100644 --- a/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java +++ b/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java @@ -68,6 +68,7 @@ public abstract class GLFWCapableBuffer { } public void changeRenderingThreadToCurrent() { + System.out.println("Currently on thread "+Thread.currentThread().getId()); glfwMakeContextCurrent(glfwWindow); GL.createCapabilities(); } @@ -90,6 +91,7 @@ public abstract class GLFWCapableBuffer { render(rendering); } }) + .bindToSingleThread() .repeat(period) .schedule(); } diff --git a/src/main/java/net/minestom/server/timer/SchedulerManager.java b/src/main/java/net/minestom/server/timer/SchedulerManager.java index bddfd29b8..698044727 100644 --- a/src/main/java/net/minestom/server/timer/SchedulerManager.java +++ b/src/main/java/net/minestom/server/timer/SchedulerManager.java @@ -7,6 +7,7 @@ import net.minestom.server.MinecraftServer; import net.minestom.server.extensions.Extension; import net.minestom.server.extensions.IExtensionObserver; import net.minestom.server.utils.thread.MinestomThread; +import net.minestom.server.utils.thread.ThreadBindingExecutor; import org.jetbrains.annotations.NotNull; import java.util.Collection; @@ -35,6 +36,8 @@ public final class SchedulerManager implements IExtensionObserver { private final AtomicInteger shutdownCounter; //A threaded execution private final ExecutorService batchesPool; + //Thread execution, which always uses the same Thread for a given Task + private final ExecutorService threadBindingPool; // A single threaded scheduled execution private final ScheduledExecutorService timerExecutionService; // All the registered tasks (task id = task) @@ -66,6 +69,7 @@ public final class SchedulerManager implements IExtensionObserver { this.shutdownCounter = new AtomicInteger(); this.batchesPool = new MinestomThread(MinecraftServer.THREAD_COUNT_SCHEDULER, MinecraftServer.THREAD_NAME_SCHEDULER); + this.threadBindingPool = new ThreadBindingExecutor(MinecraftServer.THREAD_COUNT_SCHEDULER, MinecraftServer.THREAD_NAME_SCHEDULER); this.timerExecutionService = Executors.newSingleThreadScheduledExecutor(); this.tasks = new Int2ObjectOpenHashMap<>(); this.shutdownTasks = new Int2ObjectOpenHashMap<>(); @@ -183,15 +187,26 @@ public final class SchedulerManager implements IExtensionObserver { } /** - * Gets the execution service for all the registered {@link Task}. + * Gets the execution service for all the registered {@link Task}, which are not marked as thread-bound. * - * @return the execution service for all the registered {@link Task} + * @return the execution service for all the registered {@link Task}, which are not marked as thread-bound */ @NotNull public ExecutorService getBatchesPool() { return batchesPool; } + /** + * Gets the execution service for all the registered {@link Task}, which are marked as thread-bound. + * The thread to which tasks are assigned depends on their runnable hashcode. Two (or more) tasks can be bound to the same Thread. + * + * @return the execution service for all the registered {@link Task}, which are marked as thread-bound + */ + @NotNull + public ExecutorService getThreadBindingPool() { + return threadBindingPool; + } + /** * Gets the scheduled execution service for all the registered {@link Task}. * diff --git a/src/main/java/net/minestom/server/timer/Task.java b/src/main/java/net/minestom/server/timer/Task.java index 8b7e8218a..2e3d40e7d 100644 --- a/src/main/java/net/minestom/server/timer/Task.java +++ b/src/main/java/net/minestom/server/timer/Task.java @@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Objects; +import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -42,6 +43,12 @@ public class Task implements Runnable { private ScheduledFuture future; // The thread of the task private volatile Thread currentThreadTask; + // The executor service used for this task + private final ExecutorService executorService; + // Whether this task will always execute on the same thread + private final boolean boundToSingleThread; + // Action executed on the executor. Stored inside the Task to avoid changing the hashcode (which ThreadBindingExecutor relies on) + private final Runnable action; /** * Creates a task. @@ -51,24 +58,21 @@ public class Task implements Runnable { * @param shutdown Defines whether the task is a shutdown task * @param delay The time to delay * @param repeat The time until the repetition + * @param bindToSingleThread Whether to run the given task always on the same thread. */ - public Task(@NotNull SchedulerManager schedulerManager, @NotNull Runnable runnable, boolean shutdown, long delay, long repeat, boolean isTransient, @Nullable String owningExtension) { + public Task(@NotNull SchedulerManager schedulerManager, @NotNull Runnable runnable, boolean shutdown, long delay, long repeat, boolean isTransient, @Nullable String owningExtension, boolean bindToSingleThread) { this.schedulerManager = schedulerManager; this.runnable = runnable; this.shutdown = shutdown; this.id = shutdown ? this.schedulerManager.getShutdownCounterIdentifier() : this.schedulerManager.getCounterIdentifier(); + this.executorService = bindToSingleThread ? this.schedulerManager.getThreadBindingPool() : this.schedulerManager.getBatchesPool(); this.delay = delay; this.repeat = repeat; this.isTransient = isTransient; + this.boundToSingleThread = bindToSingleThread; this.owningExtension = owningExtension; - } - /** - * Executes the task. - */ - @Override - public void run() { - this.schedulerManager.getBatchesPool().execute(() -> { + this.action = () -> { this.currentThreadTask = Thread.currentThread(); try { this.runnable.run(); @@ -84,7 +88,15 @@ public class Task implements Runnable { if (this.repeat == 0) this.finish(); this.currentThreadTask = null; } - }); + }; + } + + /** + * Executes the task. + */ + @Override + public void run() { + executorService.execute(action); } /** diff --git a/src/main/java/net/minestom/server/timer/TaskBuilder.java b/src/main/java/net/minestom/server/timer/TaskBuilder.java index f1387f0c7..287e3d3b9 100644 --- a/src/main/java/net/minestom/server/timer/TaskBuilder.java +++ b/src/main/java/net/minestom/server/timer/TaskBuilder.java @@ -36,6 +36,12 @@ public class TaskBuilder { */ private boolean isTransient; + /** + * Should this Task be run on the same thread for each run? Can be used for situations where context is bound to a + * single thread. (for instance OpenGL context) + */ + private boolean boundToSingleThread = false; + /** * Creates a task builder. *
@@ -137,6 +143,15 @@ public class TaskBuilder { return this; } + /** + * Makes this Task be run on the same thread for each run. Can be used for situations where context is bound to a + * single thread. (for instance OpenGL context) + */ + public TaskBuilder bindToSingleThread() { + boundToSingleThread = true; + return this; + } + /** * Builds a {@link Task}. * @@ -151,7 +166,8 @@ public class TaskBuilder { this.delay, this.repeat, this.isTransient, - this.owningExtension); + this.owningExtension, + this.boundToSingleThread); } /** diff --git a/src/main/java/net/minestom/server/utils/thread/ThreadBindingExecutor.java b/src/main/java/net/minestom/server/utils/thread/ThreadBindingExecutor.java new file mode 100644 index 000000000..3b8c119cb --- /dev/null +++ b/src/main/java/net/minestom/server/utils/thread/ThreadBindingExecutor.java @@ -0,0 +1,92 @@ +package net.minestom.server.utils.thread; + +import org.jetbrains.annotations.NotNull; + +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.AbstractExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * Executor service which will always give the same thread to a given Runnable. + * Uses {@link Runnable#hashCode()} to determine the thread to assign. + */ +public class ThreadBindingExecutor extends AbstractExecutorService { + + private MinestomThread[] threadExecutors; + + /** + * Creates a non-local thread-binding executor + * + * @param nThreads the number of threads + * @param name the name of the thread pool + */ + public ThreadBindingExecutor(int nThreads, String name) { + this(nThreads, name, false); + } + + /** + * @param nThreads the number of threads + * @param name the name of the thread pool + * @param local set to true if this executor is only used inside a method and should *not* be kept in the internal list of executors + */ + public ThreadBindingExecutor(int nThreads, String name, boolean local) { + threadExecutors = new MinestomThread[nThreads]; + for (int i = 0; i < nThreads; i++) { + threadExecutors[i] = new MinestomThread(1, name, local); + } + } + + @Override + public void shutdown() { + for (MinestomThread t : threadExecutors) { + t.shutdown(); + } + } + + @NotNull + @Override + public List shutdownNow() { + List allTasks = new LinkedList<>(); + for (MinestomThread t : threadExecutors) { + allTasks.addAll(t.shutdownNow()); + } + return allTasks; + } + + @Override + public boolean isShutdown() { + for (MinestomThread t : threadExecutors) { + if(!t.isShutdown()) + return false; + } + return true; + } + + @Override + public boolean isTerminated() { + for (MinestomThread t : threadExecutors) { + if(!t.isShutdown()) + return false; + } + return true; + } + + @Override + public boolean awaitTermination(long timeout, @NotNull TimeUnit unit) throws InterruptedException { + boolean terminated = true; + for (MinestomThread t : threadExecutors) { + terminated &= t.awaitTermination(timeout, unit); + } + return terminated; + } + + @Override + public void execute(@NotNull Runnable command) { + int hash = command.hashCode(); + if(hash < 0) hash = -hash; + int bucket = hash % threadExecutors.length; + + threadExecutors[bucket].execute(command); + } +} From 85ca2a5302b838d11118b4341d77fb0239be2df7 Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sat, 28 Aug 2021 14:20:47 +0200 Subject: [PATCH 2/7] No longer expose Thread-binding to Task API --- .../map/framebuffers/GLFWCapableBuffer.java | 19 ++++++++++--- .../server/timer/SchedulerManager.java | 14 ---------- .../java/net/minestom/server/timer/Task.java | 28 +++++++------------ .../minestom/server/timer/TaskBuilder.java | 18 +----------- 4 files changed, 26 insertions(+), 53 deletions(-) diff --git a/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java b/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java index 18dfb866f..4b2fbc951 100644 --- a/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java +++ b/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java @@ -4,6 +4,7 @@ import net.minestom.server.MinecraftServer; import net.minestom.server.map.Framebuffer; import net.minestom.server.map.MapColors; import net.minestom.server.timer.Task; +import net.minestom.server.utils.thread.ThreadBindingExecutor; import org.lwjgl.BufferUtils; import org.lwjgl.PointerBuffer; import org.lwjgl.glfw.GLFWErrorCallback; @@ -27,6 +28,8 @@ public abstract class GLFWCapableBuffer { private final ByteBuffer colorsBuffer; private boolean onlyMapColors; + private static ThreadBindingExecutor threadBindingPool; + protected GLFWCapableBuffer(int width, int height) { this(width, height, GLFW_NATIVE_CONTEXT_API, GLFW_OPENGL_API); } @@ -60,6 +63,12 @@ public abstract class GLFWCapableBuffer { throw new RuntimeException("("+errcode+") Failed to create GLFW Window."); } } + + synchronized(GLFWCapableBuffer.class) { + if(threadBindingPool == null) { + threadBindingPool = new ThreadBindingExecutor(MinecraftServer.THREAD_COUNT_SCHEDULER, MinecraftServer.THREAD_NAME_SCHEDULER); + } + } } public GLFWCapableBuffer unbindContextFromThread() { @@ -81,17 +90,19 @@ public abstract class GLFWCapableBuffer { return MinecraftServer.getSchedulerManager() .buildTask(new Runnable() { private boolean first = true; - - @Override - public void run() { + private final Runnable subAction = () -> { if(first) { changeRenderingThreadToCurrent(); first = false; } render(rendering); + }; + + @Override + public void run() { + threadBindingPool.execute(subAction); } }) - .bindToSingleThread() .repeat(period) .schedule(); } diff --git a/src/main/java/net/minestom/server/timer/SchedulerManager.java b/src/main/java/net/minestom/server/timer/SchedulerManager.java index 698044727..a05ef7dc2 100644 --- a/src/main/java/net/minestom/server/timer/SchedulerManager.java +++ b/src/main/java/net/minestom/server/timer/SchedulerManager.java @@ -36,8 +36,6 @@ public final class SchedulerManager implements IExtensionObserver { private final AtomicInteger shutdownCounter; //A threaded execution private final ExecutorService batchesPool; - //Thread execution, which always uses the same Thread for a given Task - private final ExecutorService threadBindingPool; // A single threaded scheduled execution private final ScheduledExecutorService timerExecutionService; // All the registered tasks (task id = task) @@ -69,7 +67,6 @@ public final class SchedulerManager implements IExtensionObserver { this.shutdownCounter = new AtomicInteger(); this.batchesPool = new MinestomThread(MinecraftServer.THREAD_COUNT_SCHEDULER, MinecraftServer.THREAD_NAME_SCHEDULER); - this.threadBindingPool = new ThreadBindingExecutor(MinecraftServer.THREAD_COUNT_SCHEDULER, MinecraftServer.THREAD_NAME_SCHEDULER); this.timerExecutionService = Executors.newSingleThreadScheduledExecutor(); this.tasks = new Int2ObjectOpenHashMap<>(); this.shutdownTasks = new Int2ObjectOpenHashMap<>(); @@ -196,17 +193,6 @@ public final class SchedulerManager implements IExtensionObserver { return batchesPool; } - /** - * Gets the execution service for all the registered {@link Task}, which are marked as thread-bound. - * The thread to which tasks are assigned depends on their runnable hashcode. Two (or more) tasks can be bound to the same Thread. - * - * @return the execution service for all the registered {@link Task}, which are marked as thread-bound - */ - @NotNull - public ExecutorService getThreadBindingPool() { - return threadBindingPool; - } - /** * Gets the scheduled execution service for all the registered {@link Task}. * diff --git a/src/main/java/net/minestom/server/timer/Task.java b/src/main/java/net/minestom/server/timer/Task.java index 2e3d40e7d..397170bd1 100644 --- a/src/main/java/net/minestom/server/timer/Task.java +++ b/src/main/java/net/minestom/server/timer/Task.java @@ -45,10 +45,6 @@ public class Task implements Runnable { private volatile Thread currentThreadTask; // The executor service used for this task private final ExecutorService executorService; - // Whether this task will always execute on the same thread - private final boolean boundToSingleThread; - // Action executed on the executor. Stored inside the Task to avoid changing the hashcode (which ThreadBindingExecutor relies on) - private final Runnable action; /** * Creates a task. @@ -58,21 +54,25 @@ public class Task implements Runnable { * @param shutdown Defines whether the task is a shutdown task * @param delay The time to delay * @param repeat The time until the repetition - * @param bindToSingleThread Whether to run the given task always on the same thread. */ - public Task(@NotNull SchedulerManager schedulerManager, @NotNull Runnable runnable, boolean shutdown, long delay, long repeat, boolean isTransient, @Nullable String owningExtension, boolean bindToSingleThread) { + public Task(@NotNull SchedulerManager schedulerManager, @NotNull Runnable runnable, boolean shutdown, long delay, long repeat, boolean isTransient, @Nullable String owningExtension) { this.schedulerManager = schedulerManager; this.runnable = runnable; this.shutdown = shutdown; this.id = shutdown ? this.schedulerManager.getShutdownCounterIdentifier() : this.schedulerManager.getCounterIdentifier(); - this.executorService = bindToSingleThread ? this.schedulerManager.getThreadBindingPool() : this.schedulerManager.getBatchesPool(); + this.executorService = this.schedulerManager.getBatchesPool(); this.delay = delay; this.repeat = repeat; this.isTransient = isTransient; - this.boundToSingleThread = bindToSingleThread; this.owningExtension = owningExtension; + } - this.action = () -> { + /** + * Executes the task. + */ + @Override + public void run() { + executorService.execute(() -> { this.currentThreadTask = Thread.currentThread(); try { this.runnable.run(); @@ -88,15 +88,7 @@ public class Task implements Runnable { if (this.repeat == 0) this.finish(); this.currentThreadTask = null; } - }; - } - - /** - * Executes the task. - */ - @Override - public void run() { - executorService.execute(action); + }); } /** diff --git a/src/main/java/net/minestom/server/timer/TaskBuilder.java b/src/main/java/net/minestom/server/timer/TaskBuilder.java index 287e3d3b9..f1387f0c7 100644 --- a/src/main/java/net/minestom/server/timer/TaskBuilder.java +++ b/src/main/java/net/minestom/server/timer/TaskBuilder.java @@ -36,12 +36,6 @@ public class TaskBuilder { */ private boolean isTransient; - /** - * Should this Task be run on the same thread for each run? Can be used for situations where context is bound to a - * single thread. (for instance OpenGL context) - */ - private boolean boundToSingleThread = false; - /** * Creates a task builder. *
@@ -143,15 +137,6 @@ public class TaskBuilder { return this; } - /** - * Makes this Task be run on the same thread for each run. Can be used for situations where context is bound to a - * single thread. (for instance OpenGL context) - */ - public TaskBuilder bindToSingleThread() { - boundToSingleThread = true; - return this; - } - /** * Builds a {@link Task}. * @@ -166,8 +151,7 @@ public class TaskBuilder { this.delay, this.repeat, this.isTransient, - this.owningExtension, - this.boundToSingleThread); + this.owningExtension); } /** From b1b1e70c408b7c47b90bb004c2d0f775890296a3 Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sat, 28 Aug 2021 14:27:52 +0200 Subject: [PATCH 3/7] Cleanup un-needed changes --- .../java/net/minestom/server/timer/SchedulerManager.java | 4 ++-- src/main/java/net/minestom/server/timer/Task.java | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/minestom/server/timer/SchedulerManager.java b/src/main/java/net/minestom/server/timer/SchedulerManager.java index a05ef7dc2..8c5ce4305 100644 --- a/src/main/java/net/minestom/server/timer/SchedulerManager.java +++ b/src/main/java/net/minestom/server/timer/SchedulerManager.java @@ -184,9 +184,9 @@ public final class SchedulerManager implements IExtensionObserver { } /** - * Gets the execution service for all the registered {@link Task}, which are not marked as thread-bound. + * Gets the execution service for all the registered {@link Task} * - * @return the execution service for all the registered {@link Task}, which are not marked as thread-bound + * @return the execution service for all the registered {@link Task} */ @NotNull public ExecutorService getBatchesPool() { diff --git a/src/main/java/net/minestom/server/timer/Task.java b/src/main/java/net/minestom/server/timer/Task.java index 397170bd1..63308058e 100644 --- a/src/main/java/net/minestom/server/timer/Task.java +++ b/src/main/java/net/minestom/server/timer/Task.java @@ -43,8 +43,6 @@ public class Task implements Runnable { private ScheduledFuture future; // The thread of the task private volatile Thread currentThreadTask; - // The executor service used for this task - private final ExecutorService executorService; /** * Creates a task. @@ -60,7 +58,6 @@ public class Task implements Runnable { this.runnable = runnable; this.shutdown = shutdown; this.id = shutdown ? this.schedulerManager.getShutdownCounterIdentifier() : this.schedulerManager.getCounterIdentifier(); - this.executorService = this.schedulerManager.getBatchesPool(); this.delay = delay; this.repeat = repeat; this.isTransient = isTransient; @@ -72,7 +69,7 @@ public class Task implements Runnable { */ @Override public void run() { - executorService.execute(() -> { + this.schedulerManager.getBatchesPool().execute(() -> { this.currentThreadTask = Thread.currentThread(); try { this.runnable.run(); From b9f1f75249a05a85f033223e5dd7d0e11d8d7e45 Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sat, 28 Aug 2021 14:28:45 +0200 Subject: [PATCH 4/7] Cleanup un-needed changes 2 --- src/main/java/net/minestom/server/timer/SchedulerManager.java | 2 +- src/main/java/net/minestom/server/timer/Task.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/timer/SchedulerManager.java b/src/main/java/net/minestom/server/timer/SchedulerManager.java index 8c5ce4305..7ca75f841 100644 --- a/src/main/java/net/minestom/server/timer/SchedulerManager.java +++ b/src/main/java/net/minestom/server/timer/SchedulerManager.java @@ -164,7 +164,7 @@ public final class SchedulerManager implements IExtensionObserver { } /** - * Gets a {@link Collection} with all the registered shutdown {@link Task}. + * Gets a {@link Collection} with all the registered shutdown {@link Task} * * @return a {@link Collection} with all the registered shutdown {@link Task} */ diff --git a/src/main/java/net/minestom/server/timer/Task.java b/src/main/java/net/minestom/server/timer/Task.java index 63308058e..8b7e8218a 100644 --- a/src/main/java/net/minestom/server/timer/Task.java +++ b/src/main/java/net/minestom/server/timer/Task.java @@ -6,7 +6,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Objects; -import java.util.concurrent.ExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; From 4184602eb0ab476e9dd94aa18074ca9f8fed0ba3 Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sat, 28 Aug 2021 14:30:49 +0200 Subject: [PATCH 5/7] oops wrong line --- src/main/java/net/minestom/server/timer/SchedulerManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/timer/SchedulerManager.java b/src/main/java/net/minestom/server/timer/SchedulerManager.java index 7ca75f841..88f82661f 100644 --- a/src/main/java/net/minestom/server/timer/SchedulerManager.java +++ b/src/main/java/net/minestom/server/timer/SchedulerManager.java @@ -164,7 +164,7 @@ public final class SchedulerManager implements IExtensionObserver { } /** - * Gets a {@link Collection} with all the registered shutdown {@link Task} + * Gets a {@link Collection} with all the registered shutdown {@link Task}. * * @return a {@link Collection} with all the registered shutdown {@link Task} */ @@ -184,7 +184,7 @@ public final class SchedulerManager implements IExtensionObserver { } /** - * Gets the execution service for all the registered {@link Task} + * Gets the execution service for all the registered {@link Task}. * * @return the execution service for all the registered {@link Task} */ From 07a05a6ed2625b8365a1cc57085866cf74d734fd Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sat, 28 Aug 2021 16:45:06 +0200 Subject: [PATCH 6/7] Remove unused import --- src/main/java/net/minestom/server/timer/SchedulerManager.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/net/minestom/server/timer/SchedulerManager.java b/src/main/java/net/minestom/server/timer/SchedulerManager.java index 88f82661f..bddfd29b8 100644 --- a/src/main/java/net/minestom/server/timer/SchedulerManager.java +++ b/src/main/java/net/minestom/server/timer/SchedulerManager.java @@ -7,7 +7,6 @@ import net.minestom.server.MinecraftServer; import net.minestom.server.extensions.Extension; import net.minestom.server.extensions.IExtensionObserver; import net.minestom.server.utils.thread.MinestomThread; -import net.minestom.server.utils.thread.ThreadBindingExecutor; import org.jetbrains.annotations.NotNull; import java.util.Collection; From 6fc89c20173ab3440efc7989500c6077d8bf614b Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Sat, 28 Aug 2021 16:46:09 +0200 Subject: [PATCH 7/7] Remove debug line --- .../net/minestom/server/map/framebuffers/GLFWCapableBuffer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java b/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java index 4b2fbc951..6afe6c960 100644 --- a/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java +++ b/src/lwjgl/java/net/minestom/server/map/framebuffers/GLFWCapableBuffer.java @@ -77,7 +77,6 @@ public abstract class GLFWCapableBuffer { } public void changeRenderingThreadToCurrent() { - System.out.println("Currently on thread "+Thread.currentThread().getId()); glfwMakeContextCurrent(glfwWindow); GL.createCapabilities(); }