[*] Clean up commands.cpp

This commit is contained in:
Reece Wilson 2022-02-19 09:05:58 +00:00
parent 86ea34c7b1
commit 0a03613a61

View File

@ -173,12 +173,14 @@ namespace Aurora::Console::Commands
void PumpCommands()
{
gMutex->Lock();
gPendingCommandsMutex->Lock();
auto commands = AuExchange(gPendingCommands, {});
gPendingCommandsMutex->Unlock();
AU_LOCK_GUARD(gMutex);
AuList<CommandDispatch> commands;
{
AU_LOCK_GUARD(gPendingCommandsMutex);
commands = AuExchange(gPendingCommands, {});
}
if ((gCommandDispatcher.pool == nullptr) ||
((gCommandDispatcher.pool.get() == Async::GetAsyncApp()) &&
(gCommandDispatcher == Async::WorkerId_t{})))
@ -194,7 +196,5 @@ namespace Aurora::Console::Commands
DispatchCommandsFromThis(commands);
}), true)->Dispatch()->BlockUntilComplete();
}
gMutex->Unlock();
}
}