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:
parent
343aec2200
commit
1682b0b6d8
5 changed files with 25 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue