Kernel: Add is_locked() to spinlock

I think this is atomic read
This commit is contained in:
Bananymous 2023-02-02 15:49:30 +02:00
parent 01f267a321
commit f6b05212e0
2 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,8 @@ namespace Kernel
SpinLock() = default;
void lock();
void unlock();
bool is_locked() const;
private:
int m_lock = 0;
};

View File

@ -16,4 +16,9 @@ namespace Kernel
spinlock_unlock_asm(&m_lock);
}
bool SpinLock::is_locked() const
{
return m_lock;
}
}