summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-25 16:59:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-25 17:28:06 +0200
commit25a5fd870caa439f22eaa0d84b924944901af84d (patch)
tree80786e57cc0310e040ae18c0300d243a314c23a0
parent09bc4cee156db7d4f846c6086ea87aff8a452b90 (diff)
downloadserenity-25a5fd870caa439f22eaa0d84b924944901af84d.zip
Kernel: Add missing locking when registering VMObjectDeletedHandlers
-rw-r--r--Kernel/VM/VMObject.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/VM/VMObject.h b/Kernel/VM/VMObject.h
index 3528eda0b4..7d2960328b 100644
--- a/Kernel/VM/VMObject.h
+++ b/Kernel/VM/VMObject.h
@@ -67,10 +67,12 @@ public:
void register_on_deleted_handler(VMObjectDeletedHandler& handler)
{
+ ScopedSpinLock locker(m_on_deleted_lock);
m_on_deleted.set(&handler);
}
void unregister_on_deleted_handler(VMObjectDeletedHandler& handler)
{
+ ScopedSpinLock locker(m_on_deleted_lock);
m_on_deleted.remove(&handler);
}