mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 01:01:54 +00:00
Kernel: Remove big lock from sys$set_coredump_metadata
The only requirement for this syscall is to make Process::m_coredump_properties SpinlockProtected.
This commit is contained in:
parent
343aec2200
commit
1682b0b6d8
Notes:
sideshowbarker
2024-07-17 14:14:14 +09:00
Author: https://github.com/Lubrsi
Commit: 1682b0b6d8
Pull-request: https://github.com/SerenityOS/serenity/pull/13592
5 changed files with 25 additions and 18 deletions
|
@ -874,15 +874,18 @@ void Process::set_dumpable(bool dumpable)
|
|||
|
||||
ErrorOr<void> Process::set_coredump_property(NonnullOwnPtr<KString> key, NonnullOwnPtr<KString> value)
|
||||
{
|
||||
// Write it into the first available property slot.
|
||||
for (auto& slot : m_coredump_properties) {
|
||||
if (slot.key)
|
||||
continue;
|
||||
slot.key = move(key);
|
||||
slot.value = move(value);
|
||||
return {};
|
||||
}
|
||||
return ENOBUFS;
|
||||
return m_coredump_properties.with([&](auto& coredump_properties) -> ErrorOr<void> {
|
||||
// Write it into the first available property slot.
|
||||
for (auto& slot : coredump_properties) {
|
||||
if (slot.key)
|
||||
continue;
|
||||
slot.key = move(key);
|
||||
slot.value = move(value);
|
||||
return {};
|
||||
}
|
||||
|
||||
return ENOBUFS;
|
||||
});
|
||||
}
|
||||
|
||||
ErrorOr<void> Process::try_set_coredump_property(StringView key, StringView value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue