Kernel: Add is_locked() to spinlock
I think this is atomic read
This commit is contained in:
@@ -14,7 +14,8 @@ namespace Kernel
|
||||
SpinLock() = default;
|
||||
void lock();
|
||||
void unlock();
|
||||
|
||||
bool is_locked() const;
|
||||
|
||||
private:
|
||||
int m_lock = 0;
|
||||
};
|
||||
|
||||
@@ -16,4 +16,9 @@ namespace Kernel
|
||||
spinlock_unlock_asm(&m_lock);
|
||||
}
|
||||
|
||||
bool SpinLock::is_locked() const
|
||||
{
|
||||
return m_lock;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user