Kernel: Optimize all SpinLocks. All locking operations are atomic

This commit is contained in:
2024-01-30 12:39:37 +02:00
parent ca8e7b40bc
commit 95e861bcdd
2 changed files with 17 additions and 60 deletions

View File

@@ -35,9 +35,8 @@ namespace Kernel
bool is_locked() const;
private:
BAN::Atomic<pid_t> m_locker = -1;
BAN::Atomic<uint32_t> m_lock_depth = 0;
SpinLock m_lock;
BAN::Atomic<pid_t> m_locker = -1;
BAN::Atomic<uint32_t> m_lock_depth = 0;
};
class RecursivePrioritySpinLock
@@ -54,10 +53,9 @@ namespace Kernel
uint32_t lock_depth() const { return m_lock_depth; }
private:
pid_t m_locker = -1;
uint32_t m_queue_length = 0;
uint32_t m_lock_depth = 0;
SpinLock m_lock;
BAN::Atomic<pid_t> m_locker = -1;
BAN::Atomic<uint32_t> m_lock_depth = 0;
BAN::Atomic<uint32_t> m_queue_length = 0;
};
}