mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Add missing locking when registering VMObjectDeletedHandlers
This commit is contained in:
parent
09bc4cee15
commit
25a5fd870c
Notes:
sideshowbarker
2024-07-18 08:21:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/25a5fd870ca
1 changed files with 2 additions and 0 deletions
|
@ -67,10 +67,12 @@ public:
|
||||||
|
|
||||||
void register_on_deleted_handler(VMObjectDeletedHandler& handler)
|
void register_on_deleted_handler(VMObjectDeletedHandler& handler)
|
||||||
{
|
{
|
||||||
|
ScopedSpinLock locker(m_on_deleted_lock);
|
||||||
m_on_deleted.set(&handler);
|
m_on_deleted.set(&handler);
|
||||||
}
|
}
|
||||||
void unregister_on_deleted_handler(VMObjectDeletedHandler& handler)
|
void unregister_on_deleted_handler(VMObjectDeletedHandler& handler)
|
||||||
{
|
{
|
||||||
|
ScopedSpinLock locker(m_on_deleted_lock);
|
||||||
m_on_deleted.remove(&handler);
|
m_on_deleted.remove(&handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue