1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-03 03:12:46 +02:00

Change command manager lock handling to avoid non-fair tryLock call

This commit is contained in:
Luck
2021-03-20 15:28:45 +00:00
parent 4564a97371
commit 6b2c4bca58

View File

@@ -141,11 +141,11 @@ public class CommandManager {
AtomicReference<Thread> thread = new AtomicReference<>();
CompletableFuture<CommandResult> 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) {