mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-20 14:39:41 +00:00
Change command manager lock handling to avoid non-fair tryLock call
This commit is contained in:
1 file changed
+2
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user