1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +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:
Luke Wilde 2022-04-09 18:30:20 +01:00 committed by Andreas Kling
parent 343aec2200
commit 1682b0b6d8
5 changed files with 25 additions and 18 deletions

View file

@ -500,11 +500,14 @@ public:
template<typename Callback>
ErrorOr<void> for_each_coredump_property(Callback callback) const
{
for (auto const& property : m_coredump_properties) {
if (property.key && property.value)
TRY(callback(*property.key, *property.value));
}
return {};
return m_coredump_properties.with([&](auto const& coredump_properties) -> ErrorOr<void> {
for (auto const& property : coredump_properties) {
if (property.key && property.value)
TRY(callback(*property.key, *property.value));
}
return {};
});
}
ErrorOr<void> set_coredump_property(NonnullOwnPtr<KString> key, NonnullOwnPtr<KString> value);
@ -833,7 +836,7 @@ private:
OwnPtr<KString> value;
};
Array<CoredumpProperty, 4> m_coredump_properties;
SpinlockProtected<Array<CoredumpProperty, 4>> m_coredump_properties;
NonnullRefPtrVector<Thread> m_threads_for_coredump;
mutable RefPtr<ProcessProcFSTraits> m_procfs_traits;