From 6b2c4bca58df120c67ba6dd5b163bc261127829c Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 20 Mar 2021 15:28:45 +0000 Subject: [PATCH] Change command manager lock handling to avoid non-fair tryLock call --- .../me/lucko/luckperms/common/command/CommandManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/command/CommandManager.java b/common/src/main/java/me/lucko/luckperms/common/command/CommandManager.java index f835c6f15..f92bdb7df 100644 --- a/common/src/main/java/me/lucko/luckperms/common/command/CommandManager.java +++ b/common/src/main/java/me/lucko/luckperms/common/command/CommandManager.java @@ -141,11 +141,11 @@ public class CommandManager { AtomicReference thread = new AtomicReference<>(); CompletableFuture future = CompletableFuture.supplyAsync(() -> { thread.set(Thread.currentThread()); - if (!this.lock.tryLock()) { + if (this.lock.isLocked()) { Message.ALREADY_EXECUTING_COMMAND.send(sender); - this.lock.lock(); } + this.lock.lock(); try { return execute(sender, label, args); } catch (Throwable e) {