Kernel: Use the AK SetOnce container class in various cases

We have many places in the kernel code that we have boolean flags that
are only set once, and never reset again but are checked multiple times
before and after the time they're being set, which matches the purpose
of the SetOnce class.
This commit is contained in:
Liav A.
2024-04-22 13:30:09 +03:00
committed by Andrew Kaster
parent 122c82a2a1
commit 2bba9411ca
41 changed files with 135 additions and 111 deletions

View File

@@ -519,7 +519,7 @@ void Process::crash(int signal, Optional<RegisterState const&> regs, bool out_of
if (out_of_memory) {
dbgln("\033[31;1mOut of memory\033[m, killing: {}", *this);
} else {
if (ip >= kernel_load_base && g_kernel_symbols_available) {
if (ip >= kernel_load_base && g_kernel_symbols_available.was_set()) {
auto const* symbol = symbolicate_kernel_address(ip);
dbgln("\033[31;1m{:p} {} +{}\033[0m\n", ip, (symbol ? symbol->name : "(k?)"), (symbol ? ip - symbol->address : 0));
} else {