1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Kernel: Protect Inode's list of watchers with spinlock instead of mutex

This commit is contained in:
Andreas Kling 2022-02-03 01:39:49 +01:00
parent 210689281f
commit e0d9472ced
2 changed files with 28 additions and 27 deletions

View file

@ -89,7 +89,7 @@ public:
static void sync_all();
void sync();
bool has_watchers() const { return !m_watchers.is_empty(); }
bool has_watchers() const;
ErrorOr<void> register_watcher(Badge<InodeWatcher>, InodeWatcher&);
void unregister_watcher(Badge<InodeWatcher>, InodeWatcher&);
@ -118,7 +118,7 @@ private:
InodeIndex m_index { 0 };
WeakPtr<Memory::SharedInodeVMObject> m_shared_vmobject;
RefPtr<LocalSocket> m_socket;
HashTable<InodeWatcher*> m_watchers;
SpinlockProtected<HashTable<InodeWatcher*>> m_watchers;
bool m_metadata_dirty { false };
RefPtr<FIFO> m_fifo;
IntrusiveListNode<Inode> m_inode_list_node;