[*] Fix deadlock on enter, when dispatching the command results in a grug handler being executed, followed by a deadlock during flush

[*] also wtf is this
This commit is contained in:
Reece Wilson 2024-03-09 08:15:30 +00:00
parent c935b892c7
commit 3c4cece69d
2 changed files with 48 additions and 41 deletions

View File

@ -711,60 +711,66 @@ namespace Aurora::Console::ConsoleTTY
void TTYConsole::NoncanonicalOnEnter()
{
AU_LOCK_GUARD(this->historyLock->AsWritable());
if (this->inputField.inputField.size())
{
AuString line;
#if defined(AURORA_IS_MODERNNT_DERIVED)
if (this->inputField.inputField == "!s")
{
EnterScrollMode();
}
else if (this->inputField.inputField == "!c")
{
LeaveScrollMode();
}
else
#endif
if (this->inputField.inputField == "!b")
{
this->iScrollPos = -1;
this->bTriggerRedraw = true;
}
else if (this->inputField.inputField == "!t")
{
this->iScrollPos = 0;
this->bTriggerRedraw = true;
}
else
{
AU_LOCK_GUARD(this->historyLock->AsWritable());
if (this->inputField.inputField.size())
{
#if defined(AURORA_IS_MODERNNT_DERIVED)
if (this->inputField.inputField == "help")
if (this->inputField.inputField == "!s")
{
AuLogInfo("ConsoleTTY: Type !s to enter scroll mode, type !c to enter host-os controlled copy/paste mode (quick-edit)");
EnterScrollMode();
}
#endif
#if defined(AURORA_IS_POSIX_DERIVED)
if (this->inputField.inputField == "help")
else if (this->inputField.inputField == "!c")
{
AuLogInfo("ConsoleTTY: Hold control + arrow key up/down to scroll.");
LeaveScrollMode();
}
else
#endif
if (this->inputField.inputField == "help")
if (this->inputField.inputField == "!b")
{
AuLogInfo("ConsoleTTY: use the command !t to scroll to the top, the command !b to lock-scroll to the bottom.");
this->iScrollPos = -1;
this->bTriggerRedraw = true;
}
else if (this->inputField.inputField == "!t")
{
this->iScrollPos = 0;
this->bTriggerRedraw = true;
}
else
{
#if defined(AURORA_IS_MODERNNT_DERIVED)
if (this->inputField.inputField == "help")
{
AuLogInfo("ConsoleTTY: Type !s to enter scroll mode, type !c to enter host-os controlled copy/paste mode (quick-edit)");
}
#endif
#if defined(AURORA_IS_POSIX_DERIVED)
if (this->inputField.inputField == "help")
{
AuLogInfo("ConsoleTTY: Hold control + arrow key up/down to scroll.");
}
#endif
if (this->inputField.inputField == "help")
{
AuLogInfo("ConsoleTTY: use the command !t to scroll to the top, the command !b to lock-scroll to the bottom.");
}
line = this->inputField.inputField;
}
AuConsole::DispatchRawLine(this->inputField.inputField);
AuTryInsert(this->history, this->inputField.inputField);
}
AuTryInsert(this->history, this->inputField.inputField);
this->inputField.Clear();
OnEnter();
}
this->inputField.Clear();
OnEnter();
AuConsole::DispatchRawLine(line);
}
void TTYConsole::NoncanonicalOnMenuLeft()

View File

@ -222,8 +222,9 @@ namespace Aurora::Debug
StackTrace ret;
EXCEPTION_RECORD ex {};
if (!bNoExit)
if (fatal && !bNoExit)
{
// TODO: why? remove?
if (!AuExchange(forceFail, true))
{
Exit::PostLevel(AuThreads::GetThread(), Exit::ETriggerLevel::eFatalException);