mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 03:57:36 +01:00
Change command manager lock handling to avoid non-fair tryLock call
This commit is contained in:
parent
4564a97371
commit
6b2c4bca58
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user