mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Kernel: {Mutex,Spinlock}::own_lock() => is_locked_by_current_thread()
Rename these API's to make it more clear what they are checking.
This commit is contained in:
parent
d9da513959
commit
0b4671add7
13 changed files with 52 additions and 52 deletions
|
@ -193,7 +193,7 @@ public:
|
|||
StringView name() const
|
||||
{
|
||||
// NOTE: Whoever is calling this needs to be holding our lock while reading the name.
|
||||
VERIFY(m_lock.own_lock());
|
||||
VERIFY(m_lock.is_locked_by_current_thread());
|
||||
return m_name ? m_name->view() : StringView {};
|
||||
}
|
||||
|
||||
|
@ -839,7 +839,7 @@ public:
|
|||
VERIFY(!Processor::current_in_irq());
|
||||
VERIFY(this == Thread::current());
|
||||
ScopedCritical critical;
|
||||
VERIFY(!Memory::s_mm_lock.own_lock());
|
||||
VERIFY(!Memory::s_mm_lock.is_locked_by_current_thread());
|
||||
|
||||
SpinlockLocker block_lock(m_block_lock);
|
||||
// We need to hold m_block_lock so that nobody can unblock a blocker as soon
|
||||
|
@ -878,8 +878,8 @@ public:
|
|||
// threads to die. In that case
|
||||
timer_was_added = TimerQueue::the().add_timer_without_id(*m_block_timer, block_timeout.clock_id(), block_timeout.absolute_time(), [&]() {
|
||||
VERIFY(!Processor::current_in_irq());
|
||||
VERIFY(!g_scheduler_lock.own_lock());
|
||||
VERIFY(!m_block_lock.own_lock());
|
||||
VERIFY(!g_scheduler_lock.is_locked_by_current_thread());
|
||||
VERIFY(!m_block_lock.is_locked_by_current_thread());
|
||||
// NOTE: this may execute on the same or any other processor!
|
||||
SpinlockLocker scheduler_lock(g_scheduler_lock);
|
||||
SpinlockLocker block_lock(m_block_lock);
|
||||
|
@ -907,7 +907,7 @@ public:
|
|||
auto previous_locked = unlock_process_if_locked(lock_count_to_restore);
|
||||
for (;;) {
|
||||
// Yield to the scheduler, and wait for us to resume unblocked.
|
||||
VERIFY(!g_scheduler_lock.own_lock());
|
||||
VERIFY(!g_scheduler_lock.is_locked_by_current_thread());
|
||||
VERIFY(Processor::in_critical());
|
||||
yield_without_releasing_big_lock();
|
||||
VERIFY(Processor::in_critical());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue